1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-25 10:21:10 +02:00
Carlos Camargo 7d9b7b803c Adding LUA tutorials: lua_calls_C1 - lua_calls_C5
Adding blinker demo: lua_blink_led
2010-09-06 20:24:53 -05:00

24 lines
434 B
Lua

package.cpath = "./?.so"
require "sram_gpio_lib"
function pulse()
sram_gpio_lib.jz_gpio_set_pin(pio,17)
delay_s(1)
sram_gpio_lib.jz_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=sram_gpio_lib.point_new()
sram_gpio_lib.jz_gpio_as_output(pio,17)
for i=0,5,1 do
pulse()
end