ESP8266 Nodemcu Pins Constant Integer values for coding

ESP8266 Nodemcu Pins Constant Integer values for coding

Share it

ESP8266 Nodemcu Pins Constant Integer values for coding

ESP8266 NodeMCU is the smallest & cheapest IoT Development board. Price is only starting from $2. There are two chipset models available, one is CH340 and another one is CP2102. You can buy it from the following links.

Buy Link

CH340 AliExpress Amazon
CP2102 AliExpress Amazon

When we write code in Arduino IDE we have to give pin name to set or low voltage operation.
For example, if we want to on or off relay using D0 pin, then we have to set digital write high for D0. This type of naming like D0, D1 is not supported for ESP8266 library. NodeMCU supports constant integer value of the pin numbers.

In the table below I have shared all the GPIO pin name and its corresponding integer value. When you will these pins, just initialize that pin name with its integer value at the top of the code.

Integer value of NodeMCU GPIO Pins

D0 16
D1 5
D2 4
D3 0
D4 2
D5 14
D6 12
D7 13
D8 15
D9 3
D10 1

Share it

2 thoughts on “ESP8266 Nodemcu Pins Constant Integer values for coding”

Leave Comment