Configurations of pin as input/output

I need to use 2 the auxiliary pins of Pixhawk as digital output, and 2 as digital input, so I would like to know how configure it.

The parameters I set are:

BRD_PWM_COUNT = 0

RELAY_PIN = 50
RELAY_PIN2 = 51
RELAY_PIN3 = -1
RELAY_PIN4 = -1

BTN_Enable = 1

BTN_PIN1 = -1
BTN_PIN2 = -1
BTN_PIN3 = 52
BTN_PIN4 = 53

BTN_REPORT_SEND = 1

Are correct the parameters I set to configure pins 1 and 2 as output and pins 3 and 4 as input?

Another question: Is it possible to use the 2 digital inputs to stop the rover without changing the firmware?

Mission Planner version: 1.3.44
Firmware version: Rover 3.1.0

Thanks

You parameter settings look fine.

Note the BTN functionality only sends a BUTTON_CHANGE event via mavlink to the GCS. It doesn’t interact with the ArduPilot software on board at all. We wrote it for the Outback Challenge so when an official pressed a button when the vehicle was on the ground at the remote site the GCS (MAVProxy in this case) would know and start a timer of 60 seconds. My point here is that you could write a GCS Module that when it got that button event you changed the mode of the Rover into HOLD. Look at the button code in here for ideas.

https://github.com/tridge/cuav/blob/master/cuav/modules/cuav_check.py

Thanks, Grant.

@gmorph

Is there a screen on Mission Planner where I can observe the changes on digital inputs?

Thanks

That’s really a Mission Planner forum question and I’m not tried it myself but I would of thought on the Status tab which shows up to ch16out you should see something there?

Thanks, Grant.

Hola. Tengo un CUAV v5 nano y estoy tratando de configurar el acuse de disparo de una camara de fotos. lo que quiero hacer es configurar un puerto para entrada digital pero no se que pin corresponde a que puerto del cuav. En pixhaux el pin 50 corresponde a aux 1 pero en cuav no se cuales son
agradezco su respuesta.
Saludos