How to Setup 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.
featured image
profile_image
Tasnim Zotder
Jan 16, 2022
⏱️ 2 Minutes

Steps 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.

1. Download Arduino IDE

Arduino IDE is an 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

Arduino IDE Download Page

2. Add NodeMCU's URL

To add the URL for NodeMCU -

  1. Open Arduino IDE
  2. Go to File --> Preferences
  3. In the "Additional Boards Manager URLs" section add the link 👉
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Arduino IDE Preferences

3. Add the Board

To Add the Board "NodeMCU" -

  1. Go to Tools --> Board: "---" --> Boards Manager
  2. Search for esp8266
  3. Install (Latest version recommended) the "esp8266" by "ESP8266 Community". It may take some time to install.
esp8266 - Boards Manager

4. Select Port & Board

To Select Port -

  1. Connect NodeMCU to the computer with a USB cable.
  2. Go to Tools --> Port and select port. In windows, the port name starts with COM, like COM3 and COM4.

To Select Board -

  1. Go to Tools --> Board --> ESP8266 Boards
  2. Select the board NodeMCU 1.0 (ESP-12E Module)
select board

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);
}
main.ino

6. Upload the Code

To upload the code to the NodeMCU and run -

  1. Click on the ✅ (tick) button to verify the code.
  2. Click on the ➡️ (right arrow) button to upload the code.
  3. Now the built-in LED on NodeMCU will start blinking.

References 📝

Thanks for Reading.

;
Contents
  • Blog
  • YouTube
Personal
  • Portfolio

github
twitter
linkedin
youtube
© Tasnim Zotder | 2022
🏡
Home
📝
Blog
💡
Portfolio