Hello every one,
I am trying to read the output pwm of AP by using Lua scripts,
this is my sample code,
where the function SRV_Channels:get_output_pwm(num) returns nil always.
I tries change “num” many times, I tried 3,4 (servo output number), and from 50 to 61(GPIO number).
function update()
output_pwm1 = SRV_Channels:get_output_pwm(53)
gcs:send_text(0, tostring (output_pwm1))
return update, 1000
end
return update, 1000
The Adrupilot firmware is ArduRover V4.2.3 (2172cfb3)
can you help me,
Thanks.
– tested on firmware 4.4 copter
– working code to fetch motor4 pwm during motor test on servo 4, the number 36 is taken from param value servo4_function, i hyave set it for motor 4 , which is 36, and now itll continuesly return pwm output of servo4