Light up the built-in LED
The built-in LED on the WebMos D1 R2 development board is shared with the TXD interface, so Serial.print() cannot be used when using the LED.
// 程序初始化
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // 设置LED_BUILTIN引脚为输出
}
// 无限循环
void loop() {
digitalWrite(LED_BUILTIN, LOW); // 点亮内置LED,内置LED设置低电压时LED实际是点亮
delay(1000); // 延时1秒
digitalWrite(LED_BUILTIN, HIGH); // 关闭内置LED
delay(1000); // 延时1秒
}
Compile and upload the code to the development board: