Module for GPIO, LED, PWM, SPI, I2C, MMIO, and Serial Linux peripheral I/O interfaces.
local periphery = require('periphery')
-- Module Version
periphery.version <string>
-- Submodules
periphery.GPIO
periphery.LED
periphery.PWM
periphery.SPI
periphery.I2C
periphery.MMIO
periphery.Serial
-- Helper Functions
periphery.sleep(seconds <number>)
periphery.sleep_ms(milliseconds <number>)
periphery.sleep_us(microseconds <number>)Property periphery.version immutable <string>Version of periphery module as a string (e.g. "1.0.0").
periphery.GPIOGPIO module. See GPIO documentation for more information.
periphery.LEDLED module. See LED documentation for more information.
periphery.PWMPWM module. See PWM documentation for more information.
periphery.SPISPI module. See SPI documentation for more information.
periphery.I2CI2C module. See I2C documentation for more information.
periphery.MMIOMMIO module. See MMIO documentation for more information.
periphery.SerialSerial module. See Serial documentation for more information.
periphery.sleep(seconds <number>)Sleep for the specified number of seconds.
periphery.sleep_ms(milliseconds <number>)Sleep for the specified number of milliseconds.
periphery.sleep_us(microseconds <number>)Sleep for the specified number of microseconds.
local periphery = require('periphery')
print("Hello World!")
periphery.sleep_ms(500)
print("Hello World 500ms later!")