This repository provides a guide on setting up the Arduino IDE for NODEMCU ESP8266 development. Follow the steps below to get started:
Download and install the Arduino IDE software from Arduino's official website.
After installing Arduino IDE, an icon will be created on your desktop. Use this icon to open the Arduino IDE.
Click on the Arduino IDE icon to open the Arduino window.
Open the "File" menu and click on "Preferences" as shown in the figure.
In the "Additional Boards Manager URLs" field, enter the following URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Click "OK" to save.
Open the "Tools" menu, go to "Board," and select "Arduino/Genuino Uno." Then, click on "Boards Manager" as shown in the figure.
In the Boards Manager window, scroll to the bottom until you find the module with the name "ESP8266." Select the module, choose the version, and click "Install." Once installed, it will display "Installed," and you can close the window.
To use ESP8266 with Arduino, select the Board: "Arduino/Genuino Uno" and change it to "NodeMCU 1.0 (ESP-12E Module)" or other ESP8266 modules based on your hardware. Scroll down to find the appropriate option.
Connect the ESP8266 module to your computer using a USB cable. When the module is connected, a COM port will be detected (e.g., COM5), as shown in the figure.
// Test code
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Click on "Tools" and select the port under "Port" based on the ESP8266 module connected to your computer. Refer to the previous steps for selecting the COM port.
- In the Blink example code, change all instances of the pin number "13" to "16."
void setup() {
// initialize digital pin 16 as an output.
pinMode(16, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
delay(10);
digitalWrite(16, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(16, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
- Click on the right arrow button (upload button) as shown in the figure to upload the program to the module.
This will start the blinking LED on the onboard LED of the NODEMCU module connected to pin D0 (GPIO16). You have successfully uploaded and run a basic program on your NODEMCU ESP8266 module using the Arduino IDE.
Feel free to explore and modify the code for more complex projects!
Now you're ready to start programming your NODEMCU ESP8266 using the Arduino IDE. Happy coding!