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.
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.
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.
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
}
Some Basic Things with NodeMCU ESP8266
Setup Arduino for NodeMCU programming
Interface With Relay (for controlling AC/DC devices)
… [Trackback]
[…] Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More on to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More on on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More Info here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More on to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More Information here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Read More Info here on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] There you will find 20259 more Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Here you will find 16617 more Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Info on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
cafe jazz music
relaxing sleep
cafe jazz
relaxing Jazz music
coffee shop music
ジャズ
… [Trackback]
[…] Find More on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Information to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
jazz relaxing music
jazz instrumental
relaxing jazz
relaxing music
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
calming music
… [Trackback]
[…] Here you can find 56433 more Information on that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More here to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
relax
beach cafe ambience
… [Trackback]
[…] Info to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
… [Trackback]
[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
sleeping music
coffee shop ambience
sleep meditation
jazz piano musisc
smooth jazz
… [Trackback]
[…] Find More to that Topic: abstractotech.com/blink-onboard-led-nodemcu-esp8266/ […]
spa music
soothing relaxation
sea cafe ambience
meditation music
piano relaxing music
peaceful space for meditation
study music