Using NodeMCU with Arduino IDE

In this blog we will see how to use NodeMCU with Arduino IDE. Once you are done with the setup you will be run arduino sketches on NodeMCU. First we need to setup the IDE.

we need to add the NodeMCU to board manager.

Goto File->Preferences and paste the following URL in additional board manager URL

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Arduino_preferences

Then goto Tools->Board->Board Manger

Arduino_BoardsManager

You should entry for ESP

NodeMCU_With_Arduino_IDE

Click on esp8266 entry , you will get option to install it. Once the installation is completed , you will have new boards in the board selection menu.

NodeMCU_With_Arduino_IDE

Now we can run the blinking LED program on NodeMCU.


void setup() {
 // initialize digital pin 13 as an output.
 pinMode(0, OUTPUT);
 Serial.begin(115200);
 Serial.println("App started");
}

// the loop function runs over and over again forever
void loop() {
 digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
 delay(1000); // wait for a second
 digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
 delay(1000); // wait for a second
}

NodeMCU_BlinkingLED

In case of NodeMCU , the pin numbers does not match with the pin numbers on NodeMCU. Here is the mapping between Arduino code and NodeMCU

NodeMCU to Arduino Pin Mapping
NodeMCU to Arduino program – Pin Mapping

 

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *