How to Set up Arduino IDE for NodeMCU
The steps to set up Arduino IDE for NodeMCU. The sketches written for Arduino can also be used for NodeMCU with a minor modification.
Also Read in 👉 How to Set up Arduino IDE for NodeMCU | Tasnim Zotder
1. Download Arduino IDE
Arduino IDE is a open-source software, which is used to write and upload codes to boards like Arduino, NodeMCU, Pi Pico etc. Arduino IDE is available for all the major OS. The current stable version is 1.8.x. It’s not recommended to use the Arduino IDE 2.x if you don’t want to deal with bugs.
Link to download Arduino IDE 👉 Software | Arduino
2. Add NodeMCU’s URL
To add the URL for NodeMCU -
- Open Arduino IDE
- Go to
File --> Preferences
- In the “Additional Boards Manager URLs” section add the link 👉 `http://arduino.esp8266.com/stable/package_esp8266com_index.json`
3. Add the Board
To Add the Board “NodeMCU” -
- Go to
Tools --> Board: "---" --> Boards Manager
- Search for
esp8266
- Install (Latest version recommended) the “esp8266” by “ESP8266 Community”. It may take some time to install.
4. Select Port & Board
To Select Port -
- Connect NodeMCU to the computer with a USB cable.
- Go to
Tools --> Port
and select port. In windows, the port name starts with COM, like COM3, COM4.
To Select Board -
- Go to
Tools --> Board --> ESP8266 Boards
- Select the board
NodeMCU 1.0 (ESP-12E Module)
5. Write a Sample Code
Like Arduino, codes for NodeMCU can be written in C
or C++
and file extension for the sketch file is .ino
. A sample code for blinking LED in NodeMCU is like that -
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // initialize the LED_BUILTIN as OUTPUT pin
}void loop() {
digitalWrite(LED_BUILTIN, 0); // Turn on the LED (for LED_BUILTIN, in turns ON on low voltage)
delay(1000); // wait for 1000 ms
digitalWrite(LED_BUILTIN, 1);
delay(500);
}
6. Upload the Code
To upload the code to the NodeMCU and run -
- Click on the ✅ (tick) button to verify the code.
- Click on the ➡️ (right arrow) button to upload the code.
- Now the built-in LED on NodeMCU will blink.
Thanks for Reading.
Also Read in 👉 How to Set up Arduino IDE for NodeMCU | Tasnim Zotder