Skip to content

Commit 3d112b2

Browse files
probonopdigrr
authored andcommitted
Use BUILTIN_LED
1 parent 683cb48 commit 3d112b2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

hardware/esp8266com/esp8266/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
Blink the blue LED on the ESP-01 module
44
Based on the Arduino Blink without Delay example
55
This example code is in the public domain
6+
7+
The blue LED on the ESP-01 module is connected to GPIO1
8+
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
9+
10+
Note that this sketch uses BUILTIN_LED to find the pin with the internal LED
611
*/
712

8-
const int ledPin = 1; // The blue LED on the ESP-01 module is connected to GPIO1
9-
// (which is also the TXD pin; so we cannot use
10-
// Serial.print() at the same time
11-
1213
int ledState = LOW;
1314

1415
unsigned long previousMillis = 0;
1516
const long interval = 1000;
1617

1718
void setup() {
18-
pinMode(ledPin, OUTPUT);
19+
pinMode(BUILTIN_LED, OUTPUT);
1920
}
2021

2122
void loop()
@@ -27,7 +28,6 @@ void loop()
2728
ledState = HIGH; // Note that this switches the LED *off*
2829
else
2930
ledState = LOW; // Note that this switches the LED *on*
30-
digitalWrite(ledPin, ledState);
31+
digitalWrite(BUILTIN_LED, ledState);
3132
}
3233
}
33-

0 commit comments

Comments
 (0)