So far we got to know how to install & configure Arduino for ESP8266 programming in a recent article. Now here we will look into the very basic programming part, to blink onboard LED on NodeMCU ESP8266 located near USB port. This can also be used to test the board in general, as you don’t need any external component other than a micro USB cable to connect it to the computer.

REQUIREMENTS

  • NodeMCU ESP8266 Board
  • Micro USB Cable
  • Arduino IDE with ESP8266 board definitions & drivers installed

GETTING READY

To blink onboard LED is as simple as 1, 2, 3 on this NodeMCU ESP8266 board as its self sufficient with everything on it. Detailed steps for the initial setup can be found here. Also note that there are two blue LEDs on board, one near WiFi chip for programming status while another one on side of the USB port for general access.

NodeMCU ESP8266 Board With LED's Marked
Green Circle: Blue Programming Status LED | Red Circle: Blue General Purpose LED

1. Connect micro USB cable’s one end to Laptop and other to board’s USB port.
2. Open Arduino IDE and choose board NodeMCU 1.0 from Tools → Boards.
3. Set baud rate to 115200 and choose the port to which it is connected.

Arduino IDE Board Selection for Blink LED Program

4. Copy the code below to IDE.
5. Go to Sketch → Upload
6. Wait for the code to get uploaded. Other blue LED near WiFi chip blinks continuously while the board is being programmed. Don’t confuse it for LED you code will blink.
7. Upon successful completion of the task, IDE will display 100% on the bottom zone and LED will start blinking.

Arduino IDE Blink LED Sketch Upload

CODE TO BLINK ONBOARD BLUE LED

#define LED D0 //Led in NodeMCU at pin GPIO16 (D0) 

void setup() 
{
 pinMode(LED, OUTPUT); //LED pin as output
}
void loop() 
{
 digitalWrite(LED, HIGH); //turn the led off
 delay(1000); //wait for 1 sec
 digitalWrite(LED, LOW); //turn the led on
 delay(1000); //wait for 1 sec 
}

There’s also a sample program in examples of IDE for blinking onboard LED. To open that, go to File → Examples → ESP8266 → Blink. Open it, upload to board & enjoy or below is the code. Here LED_BUILTIN is used to find the pin with the internal LED.

void setup() 
{
   pinMode(LED_BUILTIN, OUTPUT);    //LED_BUILTIN pin as an output
 }
 void loop() 
{
   digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on
   delay(1000);                      // Wait for a second
   digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off
   delay(2000);                      // Wait for two seconds
 }
Arduino IDE Setup Plus Blink Onboard & External LEDs
Here the first blue LED on left blinks while the board is being programmed. After upload, you will see the onboard LED near USB port blinking.

Some Basic Things with NodeMCU ESP8266

Setup Arduino for NodeMCU programming

Blink External LEDs

Interface With Relay (for controlling AC/DC devices)

Get NodeMCU ESP8266 from Amazon India

5 1 vote
Article Rating
Subscribe
Notify of
49 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
9 months ago

… [Trackback]

[…] Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

9 months ago

… [Trackback]

[…] Find More on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

9 months ago

… [Trackback]

[…] Find More on to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Find More on on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Find More Info here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Read More on to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Read More Information here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] Read More Info here on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

8 months ago

… [Trackback]

[…] There you will find 20259 more Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

7 months ago

… [Trackback]

[…] Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

7 months ago

… [Trackback]

[…] Here you will find 16617 more Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

7 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

7 months ago

… [Trackback]

[…] Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

7 months ago

… [Trackback]

[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

… [Trackback]

[…] Info on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

cafe jazz music

6 months ago

relaxing sleep

6 months ago

cafe jazz

6 months ago

relaxing Jazz music

6 months ago

coffee shop music

6 months ago

ジャズ

6 months ago

… [Trackback]

[…] Find More on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

… [Trackback]

[…] Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

jazz relaxing music

6 months ago

jazz instrumental

6 months ago

relaxing jazz

6 months ago

relaxing music

6 months ago

… [Trackback]

[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

calming music

6 months ago

… [Trackback]

[…] Here you can find 56433 more Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

6 months ago

… [Trackback]

[…] Find More here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

5 months ago

relax

5 months ago

beach cafe ambience

5 months ago

… [Trackback]

[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

5 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

5 months ago

sleeping music

5 months ago

coffee shop ambience

5 months ago

sleep meditation

5 months ago

jazz piano musisc

5 months ago

smooth jazz

5 months ago

… [Trackback]

[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]

5 months ago

spa music

5 months ago

soothing relaxation

5 months ago

sea cafe ambience

5 months ago

meditation music

5 months ago

piano relaxing music

5 months ago

peaceful space for meditation

4 months ago

study music

49
0
Would love your thoughts, please comment.x
()
x