ardupilot/libraries/AP_Scripting/examples/serial_test.lua
Michael du Breuil 51f79c1b10 AP_Scripting: Add support for UART drivers
Also improves the handling of uint32_t arguments
2020-01-13 20:06:31 -07:00

23 lines
349 B
Lua

local port = serial:find_serial(0)
port:begin(115200)
port:set_flow_control(0)
local step = 65
function spit ()
if port:available() > 0 then
read = port:read()
gcs:send_text(0, read .. " = " .. step)
end
if step > 122 then
step = 65
else
step = step + 1
end
return spit, 1000
port:write(step)
end
return spit, 1000