Getting Started with NodeMCU using Arduino IDE
NodeMCU is Lua based firmware of ESP8266. Generally, ESPlorer IDE is referred for writing Lua scripts for NodeMCU. It requires to get familiar with ESPlorer IDE and Lua scripting language.
There is another way of developing NodeMCU with a well-known IDE i.e. Arduino IDE. We can also develop NodeMCU applications using Arduino development environment. This makes things easy for Arduino developers than learning new language and IDE for NodeMCU.
Let’s see about setting up Arduino IDE with NodeMCU.
First Download Arduino IDE (version 1.6+) https://www.arduino.cc/en/Main/Software
Open Arduino IDE and Go to File -> Preference.
- Now on Preference window, Enter below link in Additional Boards Manager URLs
- Now close Preference window and go to Tools -> Board -> BoardsManager
- In Boards Manager window, Type esp in the search box, esp8266 will be listed there below. Now select latest version of board and click on install.
- After installation of the board is complete, open Tools->Board->and select NodeMCU 1.0(ESP-12E Module).
- Now Your Arduino IDE is ready for NodeMCU
Let’s see how to write simple serial print sketch using Arduino IDE for NodeMCU.
First connect NodeMCU Development Kit with PC as shown in below figure.
- After setting up Arduino IDE for NodeMCU, open Arduino IDE and write simple sketch of serial print as shown in below figure.
- Ensure that you have selected the correct board as shown in below figure. Also make sure that you have selected the appropriate COM port.
Now compile & upload the written sketch directly to the NodeMCU Dev Kit by clicking on upload button.
- Now Click on Serial Monitor (upper right corner) option to check output on serial monitor window of Arduino IDE.
Serial monitor output window will pop up with output as shown in below figure.