mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
5920c52285
toggle at 50Hz
12 lines
261 B
Lua
12 lines
261 B
Lua
|
|
-- 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
|