External i2c led (toshiba driver) on pixhawk4

Hello.
image

I want to use an additional external i2c led (toshiba driver) on pixhawk4.
But, it does not work on i2cB or I2cA, but only on i2cC shared(so, need special cable configurations) with GPS.

What should I do to use external i2c LED on i2cB or I2cA?

Thank you

In AP_Notify.cpp add the following:

On top of the file, where other #define are located

#define TOSHIBA_LED_I2C_BUS_I2C_A_PORT  3
#define TOSHIBA_LED_I2C_BUS_I2C_B_PORT  2

and below in

case Notify_LED_ToshibaLED_I2C_External:
ADD_BACKEND(new ToshibaLED_I2C(TOSHIBA_LED_I2C_BUS_EXTERNAL));

add

#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_FMUV5
                ADD_BACKEND(new ToshibaLED_I2C(TOSHIBA_LED_I2C_BUS_I2C_A_PORT));
                ADD_BACKEND(new ToshibaLED_I2C(TOSHIBA_LED_I2C_BUS_I2C_B_PORT));
#endif

before

break;

Then re-compile.

1 Like


It works fine. :slight_smile:
Thank you.!!!

I tried the given solution and the external led is working for me as well. However, I wanted to know how I can change the color of the LED upon radio failsafe? @tecnic08 @tecnic08 do you know how?