/
Sangak
/
ardupilot
Обзор
Документация
Войти
/
Sangak
/
ardupilot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
libraries/AP_Scripting/examples/simple_loop.lua
15 строк
572 B
Pierre Kancir
Tools: add LoggedNamedValueInt test
27 июн 2026, 01:07
27 июн 2026, 01:07
9f5c458
Код
Авторство
О чём код?
-- 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 gcs:send_text(0, "hello, world") -- send the traditional message gcs:send_named_float('Lua Float',number) -- send a value gcs:send_named_int('Lua Int', math.floor(number)) -- send the integer part of the value number = number + math.random() -- change the value return update, 1000 -- reschedules the loop end return update() -- run immediately before starting to reschedule