ledState = HIGH; // Note that this switches the LED *off*
} else {
ledState = LOW; // Note that this switches the LED *on*
}
digitalWrite(LED_BUILTIN, ledState);
}
}
復制代碼
作者: eagler8 時間: 2019-9-26 11:53
/*
【Arduino】108種傳感器模塊系列實驗(資料+代碼+圖形+仿真)
實驗一百二十五: 升級版 WeMos D1 R2 WiFi UNO 開發板 基于ESP8266
項目:ESP8266閃爍,由Daniel Salazar輪詢超時
*/
#include <PolledTimeout.h>
void ledOn() {
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
}
void ledOff() {
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
}
void ledToggle() {
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // Change the state of the LED
}
esp8266::polledTimeout::periodicFastUs halfPeriod(500000); //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace