
/*
ESP8266 Blink
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() {
Serial.begin(9600);
Serial.println("OK");
pinMode(2, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
Serial.println("OK");
digitalWrite(2, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is acive low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(2, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
4. กรณีมีการรอเช็คค่าเช่น วัดอุณหภูมิทุก 30 นาที ควรใช้คำสั่ง deep sleep จะทำให้อยู่ได้นานมากขึ้น
ArduinoAll ขาย Arduino ซื้อ Arduino ทุกอย่าง เปลี่ยนชื่อเป็น AllNewStep