ESP8266-01s使用CH340usb转串口模块烧录代码(基于Arduino)
下面简单介绍一下怎么给esp8266-01s模块烧录程序
1.接线(IO0管脚接地为烧录模式,代码烧录完成后需要IO0断开重新上电程序才能运行)
esp8266-01s | CH340 |
---|---|
RX | TX |
TX | RX |
GND | GND |
3.3V | 3.3V |
IO0 | GND |
2.准备简单的点亮8266模块上的LED灯程序
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}