一、WeMos D1
1、打开Arduino IDE(楼主当前版本是1.8.9)-> 首选项 -> 附加开发板管理器网址,填入:http://arduino.esp8266.com/stable/package_esp8266com_index.json,重启一下IDE
2、工具-> 开发板 -> 点击开发板管理器->滚到最下面 选择esp8266 by ESP8266 Community 版本选最新的就好,搬梯子会快一些,用国内网总是失败
3、连接板子,安装驱动,否则端口号(COMx无法选择)
4、测试连接:打开arduino的IDE界面,工具–》开发板 选择WeMos D1 R1,插上板子,看看计算机识别的串口是那个,板子上带了个CH340的usb转ttl的芯片,要先装好驱动。在 工具–》端口 选择好串口号。最后在 文件–》示例–》esp8266–》blink。一个点灯的程序就出来了。点击向右箭头的图标,就能编译上传了。一切都很顺利。8266模块的灯也开始闪烁了。
void setup() {
pinMode(D2, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(D2, 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(D2, HIGH); // Turn the LED off by making the voltage HIGH
delay(1000); // Wait for two seconds (to demonstrate the active low LED)
}