You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
396 B
24 lines
396 B
-- Lua script to write and read from a serial |
|
|
|
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 |
|
port:write(step) |
|
return spit, 1000 |
|
end |
|
|
|
return spit, 1000
|
|
|