-->
Page 1 of 1

ESP12 GPIO vs pin index

PostPosted: Sat Oct 10, 2015 10:27 am
by BigFootIT
Hi guys,
I read many and many topics but I haven't found a reply to my doubt/question... here it is:
If I connect a led on GPIO13, which is the pin index to use for pinMode() method??

I read some post where someone said to use 7 and other posts where someone said to use 13 because with the lastest version of libraries the number of GPIO and pin index have become the same value number.

So, to set GPIO13 as output what do I need to do?
Code: Select allpinMode(7, OUTPUT);

or
Code: Select allpinMode(13, OUTPUT);

??

Thanks :D

Re: ESP12 GPIO vs pin index

PostPosted: Wed Nov 04, 2015 10:10 pm
by .AleX.
Because "GPIO 13" is pin "D7" on nodeMCU , print it and keep front of view when you use nodeMCU

Image

Re: ESP12 GPIO vs pin index

PostPosted: Thu Nov 05, 2015 2:21 pm
by igrr
If you have a bare ESP12 module, pin numbers on the silkscreen match Arduino pin numbers (with an exception of GPIO 4&5, which are usually swapped on the silkscreen). So you can write pinMode(13, OUTPUT).

If you are using a NodeMCU board, you can also write pinMode(D7, OUTPUT).