mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Scripting: add send_named_float to simple loop example
This commit is contained in:
parent
fc95664580
commit
43763091bd
@ -1,7 +1,13 @@
|
|||||||
-- This script is an example of saying hello. A lot.
|
-- This script is an example of saying hello. A lot.
|
||||||
|
-- Pick a random number to send back
|
||||||
|
local number = math.random()
|
||||||
|
|
||||||
function update() -- this is the loop which periodically runs
|
function update() -- this is the loop which periodically runs
|
||||||
gcs:send_text(0, "hello, world") -- send the traditional message
|
gcs:send_text(0, "hello, world") -- send the traditional message
|
||||||
|
|
||||||
|
gcs:send_named_float('Lua Float',number) -- send a value
|
||||||
|
number = number + math.random() -- change the value
|
||||||
|
|
||||||
return update, 1000 -- reschedules the loop
|
return update, 1000 -- reschedules the loop
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user