mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_Scripting: add simple example of a loop
This commit is contained in:
parent
7842d07b12
commit
099379713c
8
libraries/AP_Scripting/examples/simple_loop.lua
Normal file
8
libraries/AP_Scripting/examples/simple_loop.lua
Normal file
@ -0,0 +1,8 @@
|
||||
-- This script is an example of saying hello. A lot.
|
||||
|
||||
function update() -- this is the loop which periodically runs
|
||||
gcs:send_text(0, "hello, world") -- send the traditional message
|
||||
return update, 1000 -- reschedules the loop
|
||||
end
|
||||
|
||||
return update() -- run immediately before starting to reschedule
|
Loading…
Reference in New Issue
Block a user