File tree 1 file changed +7
-7
lines changed
hardware/esp8266com/esp8266/libraries/esp8266/examples/BlinkWithoutDelay
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 3
3
Blink the blue LED on the ESP-01 module
4
4
Based on the Arduino Blink without Delay example
5
5
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
6
11
*/
7
12
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
-
12
13
int ledState = LOW;
13
14
14
15
unsigned long previousMillis = 0 ;
15
16
const long interval = 1000 ;
16
17
17
18
void setup () {
18
- pinMode (ledPin , OUTPUT);
19
+ pinMode (BUILTIN_LED , OUTPUT);
19
20
}
20
21
21
22
void loop ()
@@ -27,7 +28,6 @@ void loop()
27
28
ledState = HIGH; // Note that this switches the LED *off*
28
29
else
29
30
ledState = LOW; // Note that this switches the LED *on*
30
- digitalWrite (ledPin , ledState);
31
+ digitalWrite (BUILTIN_LED , ledState);
31
32
}
32
33
}
33
-
You can’t perform that action at this time.
0 commit comments