Hello! I just bought an ESP8266-01 WiFi module, and I uploaded your Blink sketch through Arduino IDE, but the LED鈥檚 not blinking at all. Please help me to solve my problem. Thanks.
Hardware: ESP-01
Version: I have the new, black coloured version.
Problem description
The ESP鈥檚 built-in blue LED lights up dimly, but nothing else happens.
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 512K(64K SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: DIO
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: ck
Sketch
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
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(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
Sketch uses 222聽201 bytes (51%) of program storage space. Maximum is 434聽160 bytes.
Global variables use 31聽576 bytes (38%) of dynamic memory, leaving 50聽344 bytes for local variables. Maximum is 81聽920 bytes.
Uploading 226352 bytes from C:\Users\Pc\AppData\Local\Temp\build8424718093711560218.tmp/Blink.cpp.bin to flash at 0x00000000
................................................................................ [ 36% ]
................................................................................ [ 72% ]
.............................................................. [ 100% ]
I've read that new variants of ESP-01 have the LED on GPIO2 - rather than GPIO1/Tx (LED_BUILTIN is defined as 1 in the generic variant of ESP8266)
I have the same Problem. Even switching GPIO1 to 2 didn`t work
@igrr how are these types of issues usually handled? Should a new board be added?
Not sure about this one. Maybe we can add another option, "Builtin LED pin", to the Generic board? It would be a bit odd to have both "Generic" and "Generic, LED on GPIO2" boards.
Can you try the LED menu now available in the latest git ?
If used in your scetch; --> pinMode (LED_BUILTIN, OUTPUT);
This line will not work: --> serial.print ("xxxx").
You should choose one.
For what it's worth: I've currently connected a NodeMCU 0.9 (ESP-12 Module). Using LED_BUILTIN as a pin number works fine to blink the NodeMCU LED (not the ESP-12 LED which is also on the board) on the NodeMCU 0.9 board. However, when using the value 13 instead (as is told by many on the internet), it wasn't working.
But it's simply straightforward to know what's the value of LED_BUILTIN. Just add this into your setup() routine and you'll know the answer:
void setup() {
Serial.begin(115200);
Serial.print("LED_BUILTIN = ");
Serial.print(LED_BUILTIN, DEC);
}
In my case, LED_BUILTIN was not 13, but 16. This is because the NodeMCU redefined the Arduino pins.
Note: for NodeMCU you can use the pins defined by NodeMCU too. For instance, use D5 (NodeMCU pin) and it will be translated to the correct Arduino GPIO pin (in that case, gpio 14).
Here's the translation:
static const uint8_t D0 = 16;
static const uint8_t D1 = 5;
static const uint8_t D2 = 4;
static const uint8_t D3 = 0;
static const uint8_t D4 = 2;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 15;
static const uint8_t D9 = 3;
static const uint8_t D10 = 1;
Led pin is now a choice in menu with generic boards. Closing.
I try with led_builtin on pin 1 and this worked,
but arduino IDE doesn't reconigse like pin else like GPIO
so led_builtin work on GPIO1
setup()
{
pinMode(MY_LED, OUTPUT);
digitalWrite(MY_LED, HIGH); //Off
)
loop()
{
delay(500);
digitalWrite(RELAY, LOW); // On
delay(500);
digitalWrite(RELAY, HIGH); //Off
}
For anyone else that was looking for it like I was, you can configure the LED's GPIO here

Most helpful comment
I try with led_builtin on pin 1 and this worked,
but arduino IDE doesn't reconigse like pin else like GPIO
so led_builtin work on GPIO1