- Sat Jan 02, 2016 5:24 pm
#37738
Is this why LUA uses SD2 and SD3 as GPIO's as well a rather curious thing to ponder for me going to give RX and TX a try here in a bit....
This is the gpio lookup for LUA firmware
Code: Select all gpiolookup = {[0]=3,[1]=10,[2]=4,[3]=9,[4]=2,[5]=1,[9]=11,[10]=12,[12]=6,[13]=7,[14]=5,[15]=8,[16]=0
in brackets is the GPIO the number is the pin number is the number after the = sign used for code.
Notice how GPIO 9 and 10 are used
Here is basic:
Code: Select all if (PinDesignaor == "D0") pin = 16;
if (PinDesignaor == "D1") pin = 5;
if (PinDesignaor == "D2") pin = 4;
if (PinDesignaor == "D3") pin = 0;
if (PinDesignaor == "D4") pin = 2;
if (PinDesignaor == "D5") pin = 14;
if (PinDesignaor == "D6") pin = 12;
if (PinDesignaor == "D7") pin = 13;
if (PinDesignaor == "D8") pin = 15;
if (PinDesignaor == "RX") pin = 3;
if (PinDesignaor == "TX") pin = 1;
GPIO's USED BASIC/LUA
GPIO- Used For Basic / Used For LUA this is the format of the table:
GPIO 0- Used for Both
GPIO 1- Used for Both
GPIO 2- Used for Both
GPIO 3- Used for Both
GPIO 4- Used for Both
GPIO 5- Used for Both
GPIO 6- NOT Used for Both
GPIO 7- NOT Used for Both
GPIO 8- NOT Used for Both
GPIO 9- Used On LUA Only
GPIO 10- Used On LUA Only
GPIO 11- NOT Used for Both
GPIO 12- Used for Both
GPIO 13- Used for Both
GPIO 14- Used for Both
GPIO 15- Used for Both
GPIO 16- Used for Both
ADC0 A0- Used Only For Basic <---- This may be incorrect but technically it is not a GPIO!
So all the GPIO's in LUA are used in Basic but LUA has 2 more GPIO's according to the table:
https://github.com/nodemcu/nodemcu-firm ... w_gpio_mapNote I did add pin 9 because it wasn't in the lookup on the wiki but it was in the table dunno if this is normal or an error in documentation on LUA's part?
Anyhow just some info on trying to unravel the full workings and mystery of what is going on here figured it may be useful to know these things as well.