Skip to content

Commit

Permalink
Add LED_BUILTIN definition (esp8266#1556)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tuxedo0801 authored and igrr committed Feb 4, 2016
1 parent 5e8be46 commit 573a0fb
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions libraries/esp8266/examples/Blink/Blink.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,7 +16,7 @@ unsigned long previousMillis = 0;
const long interval = 1000;

void setup() {
pinMode(BUILTIN_LED, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
Expand All @@ -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);
}
}
4 changes: 3 additions & 1 deletion variants/ESPDuino/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -65,4 +67,4 @@ static const uint8_t A0 = 17;
#define SERIAL_PORT_HARDWARE Serial
#define SERIAL_PORT_HARDWARE_OPEN Serial

#endif /* Pins_Arduino_h */
#endif /* Pins_Arduino_h */
1 change: 1 addition & 0 deletions variants/adafruit/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions variants/d1/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions variants/d1_mini/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions variants/espino/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions variants/generic/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions variants/nodemcu/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions variants/thing/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions variants/wifinfo/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions variants/wifio/pins_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 573a0fb

Please sign in to comment.