Advertisement
TodWulff

Switch Scanner for EdgeTX Radio

Mar 28th, 2024
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local start_time
  2. local debug_out = ""
  3. local t_max = 500
  4. local t_index = 0
  5.  
  6. local function init()
  7.   start_time = getTime()/100
  8.   debug_out = "\r\n\r\nInit'g swscanner.lua @ " .. start_time .. " seconds after startup \r\n\r\n"
  9.   serialWrite(debug_out)
  10. end
  11.  
  12. -- periodically called function
  13. local function run()
  14.     t_index = t_index + 1
  15.     if t_index <= t_max then
  16.         local fa = getSwitchName(t_index)
  17.         if fa ~= nil then
  18.             serialWrite(tostring(t_index) .. ": " .. fa .. "\r\n")
  19.         end
  20.     else
  21.         serialWrite(".")
  22.     end
  23. end
  24. return {run=run, init=init}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement