-->
Page 1 of 1

NODEMCU Development Kit v2

PostPosted: Tue Jun 02, 2015 4:13 pm
by Ralphxyz
Is there anyway in LUA to use the pin names from the Development Kit v2?
Like D0, D1, D2 instead of using 0 (GPIO16 D0), 1 (GPIO5 D1) 2 (GPIO4 D2)?

Could I map them with gpio = {[D0]=0,[D1=1,[D2]=2}

Do I have to? Seems stupid to not be able to use the labels.

Re: NODEMCU Development Kit v2

PostPosted: Sat Jun 06, 2015 5:52 am
by GerryKeely
Hi

There is an example in the NodeMCU API showing how to achieve this

Code: Select all gpio = {[0]=3,[1]=10,[2]=4,[3]=9,[4]=1,[5]=2,[10]=12,[12]=6,[14]=5,[15]=8,[16]=0}

      pin = gpio[2] -- connect the signal wire to pin 4


Gerry