[Arduino] ESP-01S初體驗

2023/02/02

系統環境:

Mac OS Big Sur 11.6

在Arduino的偏好設定下面的額外的「開發管理員網址」加入以下網址

http://arduino.esp8266.com/stable/package_esp8266com_index.json

「工具」=>「開發版」=>「開發板管理員」

開發板管理員中搜尋「ESP8266」安裝,以下畫面是已經安裝完成。

安裝完之後,視窗上面「工具」=>「開發板」=>「ESP8266 Boards」=>「Generic ESP8266 Module」

等插上ESP-01S到MAC上,記得選擇你對應的「序列埠」

以下程式碼燒錄完畢後,可以觀察ESP-01S上的LED燈是否有依照你設定的秒數亮和暗。

Code簡單測試:

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(5000); // Wait for two seconds (to demonstrate the active low LED)
}

Reference:

[1] https://blog.csdn.net/lovehuanhuan1314/article/details/122867868

[2] https://juejin.cn/post/7160175864355749895

[3] https://zhuanlan.zhihu.com/p/413606409

Edit by http://www.hangsian.com/tw/blog/