1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/romfs/led.lua

31 lines
664 B
Lua
Raw Normal View History

-- eLua test
if pd.board() == "SAM7-EX256" then
ledpin = pio.PB_20
elseif pd.board() == "EK-LM3S8962" or pd.board() == "EK-LM3S6965" then
ledpin = pio.PF_0
2008-09-01 20:32:43 +00:00
elseif pd.board() == "STR9-COMSTICK" then
ledpin = pio.P9_0
2008-09-01 20:32:43 +00:00
elseif pd.board() == "LPC-H2888" then
ledpin = pio.P2_1
else
2008-09-01 20:32:43 +00:00
print( "\nError: Unknown board " .. pd.board() .. " !" )
return
end
function cycle()
pio.set( ledpin )
tmr.delay( 0, 500000 )
pio.clear( ledpin )
tmr.delay( 0, 500000 )
end
pio.output( ledpin )
2008-08-09 11:15:39 +00:00
print( "Hello from eLua on " .. pd.cpu() )
print "Watch your LED blinking :)"
print "Press any key to end this demo.\n"
while uart.recv( 0, 0, 0 ) < 0 do
cycle()
end