mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
f8507a7c05
romfs Lua examples refactored to work with pio module examples were _not_ tested after renaming gpio to pio (but should be ok)
20 lines
357 B
Lua
20 lines
357 B
Lua
local pio = pio
|
|
|
|
module(...)
|
|
|
|
BTN_UP = "PE_0"
|
|
BTN_DOWN = "PE_1"
|
|
BTN_LEFT = "PE_2"
|
|
BTN_RIGHT = "PE_3"
|
|
BTN_SELECT = "PF_1"
|
|
btnpressed = function( button )
|
|
return ( pio[ button ] == 0 )
|
|
end
|
|
|
|
LED_1 = "PF_0"
|
|
|
|
pio.PE_0_3_DIR, pio.PF_1_DIR = pio.INPUT, pio.INPUT
|
|
pio.PE_0_3_PULL, pio.PF_1_PULL = pio.PULLUP, pio.PULLUP
|
|
pio.PF_0_DIR = pio.OUTPUT
|
|
|