How to set up the GPIO?

Hi folks.
I am trying to set up a relay on a Holybro 6c with software 4.3.
Servo16 = -1
On the user parameters, RC16_Option = Relay On/Off
It feels like I’ve missed something.
Do any of you have experience setting up GPIO??

Per the FMU pinout, it looks like you need to set RELAY_PIN=57.

Pixhawk 6C Flight Controller — Copter documentation (ardupilot.org)

Be sure your radio actually supports 16 channels. You don’t need to use channel 16. Whatever channel is set to RCx_OPTION=28 will operate the relay.

You may prefer to map RELAY2 instead, since the first relay is generally used for camera operation.

I’ve written an article that may be helpful.

https://www.coptercam.tech/technical-article-using-relays-for-camera-shutter-control-in-ardupilot/

Thank you all friends for the answer, I will test further next weekend. Happy weekend everyone

//YB

Hello all friends
I have set up a three position switch on my TX16S and see on Missionplanner that the set channel gives the correct response. RELAY2_LOW, RELAY2_MIDDLE and RELAY2_HIGH.
Is there any way to control two different relays with the same channel?.
Have a nice flight //YB

How are you using a relay with 3 output levels? Relay’s are on/off. Not sure what you are trying to do. You can easily mix 2 RC channels from the same switch on the transmitter.

Sorry if I was unclear with my question.
Mission planner shows three different states for the RC channel. The idea was that I could somehow activate two different relays…

Just wire them both to the same output pin.

Or if you are intending to use all 3 states, then do as Dave suggests and use a transmitter mix.

That shows 3 different PWM levels depending on how you have mixed the channel to the switches but it’s not useful for a relay. Yuri’s suggesting is the simplest if you just want to trigger 2 relays together.