-->
Page 1 of 3

Learning how GPIO pin assign? [NEWBIE]

PostPosted: Tue Jun 21, 2016 3:31 am
by Dika
Hello there..
These things, are new for me, like microcontroller, module, and etc.
Well, for the first, i search the code example. And i found it. But i wonder what does this code mean?
Code: Select allLAMP1=1
LAMP2=2
LAMP3=7
LAMP4=5
gpio.mode(LAMP1,gpio.OUTPUT)
gpio.mode(LAMP2,gpio.OUTPUT)
gpio.mode(LAMP3,gpio.OUTPUT)
gpio.mode(LAMP4,gpio.OUTPUT)
gpio.write(LAMP1,gpio.LOW)
gpio.write(LAMP2,gpio.LOW)
gpio.write(LAMP3,gpio.LOW)
gpio.write(LAMP4,gpio.LOW)


It seems the owner using esp8266-12, mine is esp8266-07.
Could someone explain to me what does that code?
specially these lines :
Code: Select allLAMP1=1
LAMP2=2
LAMP3=7
LAMP4=5

Many thanks :)

Re: Learning how GPIO pin assign? [NEWBIE]

PostPosted: Tue Jun 21, 2016 8:37 pm
by Mmiscool
specifying the pin numbers for each of the pins.

Re: Learning how GPIO pin assign? [NEWBIE]

PostPosted: Wed Jun 22, 2016 9:39 am
by Dika
Hi Mmiscool..
Thanks for the answer. Still, not clear yet
From this code
Code: Select allLAMP1=1
LAMP2=2
LAMP3=7
LAMP4=5


Image
We got pin 1,2,7,5. But from esp8266-07 pinout, there is no such GPIO 7?.
Sorry for stupid question :)
Thanks

Re: Learning how GPIO pin assign? [NEWBIE]

PostPosted: Wed Jun 22, 2016 10:37 pm
by Mmiscool
gpio 7 is not broken out. was this code originally for a regular arduino?