AP_Scripting: added RCIN example script

This commit is contained in:
Andrew Tridgell 2019-12-04 13:10:05 +11:00 committed by WickedShell
parent e86c6b047a
commit 07415d06ab

View File

@ -0,0 +1,13 @@
-- example of getting RC input
function update()
pwm1 = rc:get_pwm(1)
pwm2 = rc:get_pwm(2)
pwm3 = rc:get_pwm(3)
pwm4 = rc:get_pwm(4)
gcs:send_text(0, "RCIN 1:" .. tostring(pwm1) .. " 2:" .. tostring(pwm2).. " 3:" .. tostring(pwm3).. " 4:" .. tostring(pwm4))
return update, 1000 -- reschedules the loop
end
return update()