I would like to implement a function so that when an rc input is changed (switch from rc controller) an rc pwm out goes to a predefined value until a micro switch is triggered. This is to drive a esc driven motor to a mechanical stop.
How would I most easily setup something like this? Is a Lua script the solution or are there any simpler way? Seems like it should not be particularly complicated to achieve. I’m thinking the microswitch connects to a gpio pin.
Hardware is a pixhawk 1 clone “HKPilot32” (fmu v2) running copter 4.2.
Please point me in the right direction. Have never done any lua before, but do not even know if lua is the solution