Getting Started With ESP8266 / Nodemcu With Arduino IDE

Introduction: Getting Started With ESP8266 / Nodemcu With Arduino IDE

Hi guys since esp 8266 boards are very cheap and offers alot of functionalities so they are a very good choice to use for any project and they are a perfect replacement for arduino boards as well. So, in this instructables we will learn how to use ESP8266 or NODEMCU or any other esp8266 based boards with Arduino IDE.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Things You Need

For this instructables we will need following things :

Any esp8266 boards (in my case nodemcu)


LED

RESISTOR

JUMPER WIRES


BREADBOARD

Step 2: Install Esp8266 Boards in Our Arduino IDE

To install the ESP8266 board in your Arduino IDE, follow these next instructions:

-> In your Arduino IDE, go to File> Preferences

-> Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into the “Additional Boards Manager URLs” field as shown in the figure below. Then, click the “OK”
button.

Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma.

-> Open the Boards Manager. Go to Tools > Board > Boards Manager…


Search for ESP8266 and press install button for the “ESP8266 by ESP8266 Community“:

That’s it. It should be installed after a few seconds.

Step 3: Schmatics

For the first and very simple sketch we will Blink a Led With ESP8266 for that i connected a LED to D4 pin of Nodemcu so please connect a LED to pin D4 of your esp8266 and if your board don't have any D4 pin you can connect it to any Pin but keep in mind whichever pin you connect your LED to , you need to use that pin in Code instead of D4. So please help yourself with above attached schmatics.

Step 4: Code

Please copy the following code and upload it to the nodemcu Board :

int pin = 2; // GPIO2 is D4 on nodemcu board

void setup()

{

// initialize GPIO 2 as an output.

pinMode(pin, OUTPUT);

}

// the loop function runs over and over again forever

void loop()

{

digitalWrite(pin, HIGH);

// turn the LED on (HIGH is the voltage level)

delay(1000);

// wait for a second

digitalWrite(pin, LOW);

// turn the LED off by making the voltage LOW

delay(1000);

// wait for a second

}

////////////////////

You can use the above code or you can upload the blink example from arduino ide and put the Led Pin in the code According to your Led connected to your board and after Uploading the code your led will start blinking.

So have fun using esp8266 with Arduino IDE.

Be the First to Share

    Recommendations

    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    Discussions