Skip to content

Instantly share code, notes, and snippets.

@Spiritdude
Created March 17, 2018 05:35
Show Gist options
  • Save Spiritdude/9243768690f31d88ed33d6dbebde224e to your computer and use it in GitHub Desktop.
Save Spiritdude/9243768690f31d88ed33d6dbebde224e to your computer and use it in GitHub Desktop.
Unified gpio documentation example

GPIO

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,...)

gpio.mode

Initialize pin to GPIO mode, set the pin in/out direction, and optional internal weak pull-up.

Syntax

gpio.mode(pin, mode [, pullup])

Specifics

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

gpio.config

Initialize multiple pins to GPIO mode, set the pin in/out direction, and optional internal weak pull-up.

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment