mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Add LED_BUILTIN definition (#1556)
keep arduino incompatible BUILTIN_LED (+22 squashed commits) [e124f9c
] keep arduino incompatible BUILTIN_LED [18dab66
] keep arduino incompatible BUILTIN_LED [0095de6
] keep arduino incompatible BUILTIN_LED [cca2714
] keep arduino incompatible BUILTIN_LED [ff62bfb
] keep arduino incompatible BUILTIN_LED [fd6f7c0
] keep arduino incompatible BUILTIN_LED [220b02a
] keep arduino incompatible BUILTIN_LED [b871b1b
] keep arduino incompatible BUILTIN_LED [1d97cac
] keep arduino incompatible BUILTIN_LED [ebc2667
] changed BUILTIN_LED to LED_BUILTIN [7008a27
] changed BUILTIN_LED to LED_BUILTIN [cf3f6da
] changed BUILTIN_LED to LED_BUILTIN [5e11c43
] changed BUILTIN_LED to LED_BUILTIN [8645bd5
] changed BUILTIN_LED to LED_BUILTIN [faae742
] changed BUILTIN_LED to LED_BUILTIN [df2659b
] changed BUILTIN_LED to LED_BUILTIN [1eb74d5
] changed BUILTIN_LED to LED_BUILTIN [fb9e977
] changed BUILTIN_LED to LED_BUILTIN [b735737
] changed BUILTIN_LED to LED_BUILTIN [d0557dd
] changed BUILTIN_LED to LED_BUILTIN [a25e4aa
] changed BUILTIN_LED to LED_BUILTIN [7865ace
] changed BUILTIN_LED to LED_BUILTIN
This commit is contained in:
@ -6,19 +6,19 @@
|
||||
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
|
||||
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
|
||||
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
|
||||
}
|
||||
|
||||
// the loop function runs over and over again forever
|
||||
void loop() {
|
||||
digitalWrite(BUILTIN_LED, LOW); // Turn the LED on (Note that LOW is the voltage level
|
||||
digitalWrite(LED_BUILTIN, 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(BUILTIN_LED, HIGH); // Turn the LED off by making the voltage HIGH
|
||||
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
|
||||
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
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
|
||||
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
|
||||
*/
|
||||
|
||||
int ledState = LOW;
|
||||
@ -16,7 +16,7 @@ unsigned long previousMillis = 0;
|
||||
const long interval = 1000;
|
||||
|
||||
void setup() {
|
||||
pinMode(BUILTIN_LED, OUTPUT);
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@ -28,6 +28,6 @@ void loop()
|
||||
ledState = HIGH; // Note that this switches the LED *off*
|
||||
else
|
||||
ledState = LOW; // Note that this switches the LED *on*
|
||||
digitalWrite(BUILTIN_LED, ledState);
|
||||
digitalWrite(LED_BUILTIN, ledState);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user