Hello,
I have implemented Button capabilities into lua scripting. All works as expected when I set the following on a physical drone:
BTN_ENABLE 1
BTN_PIN1 54
SERVO13_FUNCTION -1 (GPIO)
However I’d like to be able to do preliminary testing of the lua scripting with the Simulation Copter.
If I set Button and Servo parameters as shown above on the Simulation Copter, the following PreArm error is reported in the Messages Tab of Mission Planner.
PreArm: BTN_PIN1=54 invalid
I dug into the Ardupilot code and know that the error is reported from the AP_Button::arming_checks function. However, I quickly get lost attempting to follow the hal.gpio->valid_pin(pin[i]) implementation from the arming_checks function.
Should I expect the Buttons feature to work in the Simulation Copter?
Or
Are Buttons a feature that is just not available in the Simulation Copter?