PixRacer: Relay Pin for Camera Trigger [solved]

Hi all,

I am trying to setup a camera relay trigger with PixRacer.
CH7 is working, BRD_PWM_COUNT = 4, CAM_TRIGG_TYPE = 1

I tried all numbers listed in Mission Planner but without success.
Looking at the code at https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Relay/AP_Relay.cpp
the relay pins seem to be undefined (-1).

#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
#define RELAY1_PIN_DEFAULT 111
#define RELAY2_PIN_DEFAULT -1
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4)
#define RELAY1_PIN_DEFAULT -1
#define RELAY2_PIN_DEFAULT -1
#else
#define RELAY1_PIN_DEFAULT 54
#define RELAY2_PIN_DEFAULT 55

Is this correct? How are these numbers determined? Can it be changed to any number like:

#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4)
#define RELAY1_PIN_DEFAULT 99

?

TIA and best regards,
Thorsten

1 Like

Those are the default values when first loaded. Pixracer output pins are the same as the AUX pins on Pixhawk. 50 - pin 1, 55 - pin 6. Set relay pin to 55 to use that pin as a relay pin. Do not use 50 as this is used for motor 1.

Mike

1 Like

Thanks, makes sense and works. Not sure why it didn’t work before when I tested it with these setting…

Ya, finding the parameter to change is a pain. Tried to test PWM the other day and wasn’t getting it to work until I found the other parameter I didn’t change.

Mike