mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_Scripting: added RCIN example script
This commit is contained in:
parent
e86c6b047a
commit
07415d06ab
13
libraries/AP_Scripting/examples/RCIN_test.lua
Normal file
13
libraries/AP_Scripting/examples/RCIN_test.lua
Normal 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()
|
Loading…
Reference in New Issue
Block a user