mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-04-21 12:27:27 +03:00
Adding file-system
This commit is contained in:
28
sie_fs/root/scripts/lua/test_gpio.lua
Normal file
28
sie_fs/root/scripts/lua/test_gpio.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
package.cpath = "./?.so"
|
||||
require "gpio"
|
||||
|
||||
PORT_A = 0
|
||||
PORT_B = 1
|
||||
PORT_C = 2
|
||||
PORT_D = 3
|
||||
|
||||
function pulse()
|
||||
gpio.set_pin(pio,17)
|
||||
delay_s(1)
|
||||
gpio.clear_pin(pio,17)
|
||||
delay_s(1)
|
||||
end
|
||||
|
||||
function delay_s(delay)
|
||||
delay = delay or 1
|
||||
local time_to = os.time() + delay
|
||||
while os.time() < time_to do end
|
||||
end
|
||||
|
||||
pio=gpio.open_port(PORT_C)
|
||||
gpio.gpio_as_output(pio,17)
|
||||
|
||||
for i=0,2,1 do
|
||||
pulse()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user