You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
-- toggle a relay at 50Hz |
|
|
|
local RELAY_NUM = 0 |
|
|
|
function update() -- this is the loop which periodically runs |
|
relay:toggle(RELAY_NUM) |
|
return update, 20 -- reschedules the loop at 50Hz |
|
end |
|
|
|
return update() -- run immediately before starting to reschedule
|
|
|