Simple blink ESP8266 beginner problem

Hello all.

At first I have to say, that am pure beginner with the Arduino IDE, so if am doing something wrong, just
let me know.

I have question regarding simple blink program on my Wemos ESP8266 board

So, for my first project I would like to perform simple blink sketch. I did everything by the book, but light on my board doesnt blink. In Boards manager I installed ESP package with this link https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json

Im using this code:

/*
  ESP8266 Blink by Simon Peter
  Blink the blue LED on the ESP-01 module
  This example code is in the public domain

  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 LED_BUILTIN to find the pin with the internal LED
*/

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 active 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)
}

After upload, i get this text from Arduino IDE:

esptool.py v2.8
Serial port COM4
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: dc:4f:22:4c:3d:b5
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash params set to 0x0330
Compressed 261376 bytes to 193116...

Writing at 0x00000000... (8 %)
Writing at 0x00004000... (16 %)
Writing at 0x00008000... (25 %)
Writing at 0x0000c000... (33 %)
Writing at 0x00010000... (41 %)
Writing at 0x00014000... (50 %)
Writing at 0x00018000... (58 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (75 %)
Writing at 0x00024000... (83 %)
Writing at 0x00028000... (91 %)
Writing at 0x0002c000... (100 %)
Wrote 261376 bytes (193116 compressed) at 0x00000000 in 17.1 seconds (effective 121.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

.....but nothing happens. I also tried to holding the flesh button on Wemos board during uploading of code to board.

What am doing it wrong? I wonder if is maybe problem with Wemos board, maybe this board doesnt support blinking (but there is green light on the board).

Thanks for feedbacks!

Usually LED_BUILTIN will map to the correct pin however with some of these generic boards there are a number of variants so there is at least a possibility that the value of LED_BUILTIN does not match the configuration of the variant. Try for example one of the following pins: 1, 2, 13, 16.

BitSeeker thanks for your replay.

I must point out, that with this code I would like to perform blinking with light on the board (not with external light).

Can anyone confirm me, that response from Arduino IDE means, that the code is properly uploaded.

Yes, my reply takes that into account. The internal LED on different variants of ESP8266 boards can be connected to different pins depending on design and manufacturer. As I said, LED_BUILTIN usually gets this right, but depending on what board you actually have and what you pick from the list in the IDE, the pin assigned to LED_BUILTIN may not match the board, hence my suggestion to directly try the most common pins.

Sorry for stupid question, but where in Arduino IDE I can specify which GPIO to use? In the blink code?

blaz_slo:
Sorry for stupid question, but where in Arduino IDE I can specify which GPIO to use? In the blink code?

You can do this in your code by providing an alternative GPIO pin number to the digitalWrite() function. For example in your code you have:

digitalWrite(LED_BUILTIN, LOW);
delay(1000); 
digitalWrite(LED_BUILTIN, HIGH);
delay(2000)

Instead simply write for example as follows:

digitalWrite(1, LOW);
delay(1000); 
digitalWrite(1, HIGH);
delay(2000)

Or try any of the other pin numbers I suggested within that statement.

LED_BUILTIN is a just macro (token/tag if you like) that gets substituted for a pin number when the sketch is compiled. The actual number that gets substituted depends on the selected board. On my Lolin ESP8266 board, the sketch does actually work and blinks the blue LED on the ESP8266 module.

BTW, does the blue led flicker during the upload?

Yes, it works now!

Thank you for help, now some things are clear to me :wink:

Glad to hear that. You're welcome.