This module provides access to the GPIO (General Purpose Input/Output) subsystem.
gpio.mode(pin,mode,...)
gpio.config({pin=p, mode=m, dir=d, ...})
gpio.write(pin,v)
gpio.read(pin)
gpio.trig(pin,...)
Initialize pin to GPIO mode, set the pin in/out direction, and optional internal weak pull-up.
gpio.mode(pin, mode [, pullup])
Feature | ESP8266 | ESP32 | Linux |
---|---|---|---|
gpio.INPUT |
supported | supported | Raspberry: all GPIO supported, NanoPi NEO: ..., Orange Pi Zero: ... |
gpio.OUTPUT |
supported | supported | dito |
gpio.PULLDOWN |
... | ... | |
gpio.PULLUP |
... | ||
gpio.PULLUPDOWN |
|||
etc |
Initialize multiple pins to GPIO mode, set the pin in/out direction, and optional internal weak pull-up.
...