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 2 votes
Article Rating
Subscribe
Notify of
72 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

cafe jazz music

2 years ago

relaxing sleep

2 years ago

cafe jazz

2 years ago

relaxing Jazz music

2 years ago

coffee shop music

2 years ago

ジャズ

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

jazz relaxing music

2 years ago

jazz instrumental

2 years ago

relaxing jazz

2 years ago

relaxing music

2 years ago

… [Trackback]

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

2 years ago

calming music

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

relax

2 years ago

beach cafe ambience

2 years ago

… [Trackback]

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

2 years ago

… [Trackback]

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

2 years ago

sleeping music

2 years ago

coffee shop ambience

2 years ago

sleep meditation

2 years ago

jazz piano musisc

2 years ago

smooth jazz

2 years ago

… [Trackback]

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

2 years ago

spa music

2 years ago

soothing relaxation

2 years ago

sea cafe ambience

2 years ago

meditation music

2 years ago

piano relaxing music

2 years ago

peaceful space for meditation

2 years ago

study music

URL
1 year ago

… [Trackback]

[…] Read More: abstractotech.com/blink-onboard-led-nodemcu-esp8266/trackback/ […]

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