From 496fee1a15e083041347cfa8bc936da2f68d755e Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 21 Jun 2015 21:27:27 +0200 Subject: [PATCH] Use BUILTIN_LED --- .../BlinkWithoutDelay/BlinkWithoutDelay.ino | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino index 138e70714..740211d6d 100644 --- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -3,19 +3,20 @@ Blink the blue LED on the ESP-01 module Based on the Arduino Blink without Delay example 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 BUILTIN_LED to find the pin with the internal LED */ -const int ledPin = 1; // 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 - int ledState = LOW; unsigned long previousMillis = 0; const long interval = 1000; void setup() { - pinMode(ledPin, OUTPUT); + pinMode(BUILTIN_LED, OUTPUT); } void loop() @@ -27,7 +28,6 @@ void loop() ledState = HIGH; // Note that this switches the LED *off* else ledState = LOW; // Note that this switches the LED *on* - digitalWrite(ledPin, ledState); + digitalWrite(BUILTIN_LED, ledState); } } -