第一步:讓arduinoIDE支持wemos D1MiNi
選擇“文件/首選項”
第二步:將開發板添加到IDE裏
將http://arduino.esp8266.com/stable/package_esp8266com_index.json這個json地址鍵入下圖所示紅框的位置,點擊“好”。
補充:點擊右側這個按鈕可以讓你同時鍵入多個開發板的json。用行隔開就行 不需要單獨加符號
第三步:添加開發板
選擇“工具/開發板/開發板管理”
第四部:
在打開的開發板管理器界面 搜索“esp”,安裝下圖紅框這個,版本號可能因爲你跟我安裝的時間不同而有所不同。不重要、
第五步:
選擇好開發板 參數如圖所示設置就好
第六步:打開自帶的demo
第七步 在D1和G上連接一個led串一個220歐電阻
第八步 編譯上傳 就可以看到燈閃爍了
/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
void setup() {
pinMode(D4, OUTPUT); // D4引腳設置成輸出
}
void loop() {
//D4上的led亮5s滅1s 板載led亮1s滅5s
digitalWrite(D4, HIGH); // 將D4引腳設爲高電平(板載燈連接的這個引腳但是反向 所以板載燈閃爍和外界LED相反
delay(5000); // 延時5秒
digitalWrite(D4, LOW); // 將D4引腳設爲低電平
delay(1000); // 延時1s
}