Hi all
Can one button lets say button C control 2 different servo outputs? I have a plane that has flaps for landing as well as landing lights. Both use different PWMs and was wondering if I can set it up so I dont have to have a button for the lights and another button for the flaps. This will give me a free button for another use. Is this possible or is this something in future updates?
Cheers!
I think that might be possible using lua scripting. You could also use relative altitude to activate the landing lights.
I was thinking the lights will switch on once the flaps are fully down and switch off once flaps are up. Not when the button is pressed. This will give me an indication of the flaps position assuming everything is mechanically working
Yes, it is quite easy using
get_output_pwm(output_function)
https://ardupilot.org/copter/docs/common-lua-scripts.html
I think it should work approximately like this, but it is not tested:
function landinglights ()
if SRV_Channels:get_output_pwm(x) > 1900 then -- x is the channel number
servo.set_output (function_number, 1900) -- (function_number e.g. 94 must be assigned to the output channel within Arducopter) or if relay
relay:on(relay_num)
else
servo.set_output (function_number, 1000) -- or if relay
relay:off(relay_num)
end
return landinglights, 1000
end
return landinglights, 1000
Thanks alot. Will look into that!
Cheers
Looking to hire a programmer for my Tarot drone and herelink Transmitter. I am based out of the Dallas area. Can someone please help me. Thanks, jc2121978@gmail.com
What do you need Jaime ?