mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +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:
parent
5e8be46e84
commit
573a0fb47f
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 16;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 16;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -42,6 +42,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 0;
|
||||
static const uint8_t BUILTIN_LED = 0;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -42,6 +42,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;//new ESP-12E GPIO2
|
||||
static const uint8_t BUILTIN_LED = 2;//new ESP-12E GPIO2
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -42,6 +42,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -42,6 +42,11 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
static const uint8_t LED_BUILTIN_R = 2;
|
||||
static const uint8_t LED_BUILTIN_G = 4;
|
||||
static const uint8_t LED_BUILTIN_B = 5;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
static const uint8_t BUILTIN_LEDR = 2;
|
||||
static const uint8_t BUILTIN_LEDG = 4;
|
||||
|
@ -43,6 +43,7 @@ static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 1;
|
||||
static const uint8_t LED_BUILTIN = 1;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
||||
|
@ -42,6 +42,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 16;
|
||||
static const uint8_t BUILTIN_LED = 16;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -42,6 +42,8 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 5;
|
||||
|
||||
static const uint8_t BUILTIN_LED = 5;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -47,6 +47,7 @@ static const uint8_t MOSI = 13;
|
||||
static const uint8_t MISO = 12;
|
||||
static const uint8_t SCK = 14;
|
||||
|
||||
static const uint8_t LED_BUILTIN = 12;
|
||||
static const uint8_t BUILTIN_LED = 12;
|
||||
|
||||
static const uint8_t A0 = 17;
|
||||
|
@ -60,6 +60,7 @@ static const uint8_t E14 = ESP_PINS_OFFSET + 14;
|
||||
static const uint8_t E15 = ESP_PINS_OFFSET + 15;
|
||||
static const uint8_t E16 = ESP_PINS_OFFSET + 16;
|
||||
|
||||
static const uint8_t LED_BUILTIN_LED = 2;
|
||||
static const uint8_t BUILTIN_LED = 2;
|
||||
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
|
Loading…
x
Reference in New Issue
Block a user