Nodemcu basics | blink on board led | #1
Introduction
- This is the best program to test on a new node MCU board
- It blinks the LED on the board so other hardware components a re not required
- This program also helps to check that your board in working fine
Step 1: Set up the IDE
- Download the Arduino IDE.
- Install the Arduino IDE and opens it.
- Go to File > Preferences.
- Add http://arduino.esp8266.com/stable/package_esp8266com_index.json to the Additional Board Manager URLs
- Go to Tool > Boards > Boards Manager.
- Search for esp8266 and then install the board.
- Restart the your Arduino IDE.
Step2: 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 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)
}
- Now copy and paste this code in your IDE
Step 3: Uploading the code
- Now choose the corresponding port and board to your
- Now press the upload button
Comment if you face any error in this program
Comments
Post a Comment