LED Strips controlled by Arduino/Pi as status indicator from FC

Hi there,
I currently have an arduino controlling nav lights on my X8 drone. It’s a very big drone so it has about 80leds on each arm!
Currently the arduino is disconnected from the FC and is just showing red and green with a white strobe.
What is like is to connect it to the FC so that for example:

Armed is red and green with white strobe
Ready to arm is Purple
Error is flashing red
Fail safe is strobe red/white

These color don’t matter as I can figure that out later but what I’m stuck on is how to get the status of the craft from the FC? And how would I link a status with a led color.
I’m new to code but not new to ardu pilot and drones :grin:

Thanks

Write a Lua script, and unless they are bizarrely exotic LEDs, ditch the Arduino.

Use the LED:get_rgb() binding to display standard NTF colors.

Lua Scripts — Copter documentation (ardupilot.org)
External LEDs — Copter documentation (ardupilot.org)
NeoPixel — Copter documentation (ardupilot.org)
ardupilot/libraries/AP_Scripting/examples/LED_poslight.lua at master · ArduPilot/ardupilot (github.com)

Forgot to mention, the LEDS i’m using are RGBW which im fairly certain AP doesn’t support. also doesn’t AP have a led limit? something like 33? I have about 320 lol.

Exactly which LEDs? RGBW doesn’t tell us much.

If they aren’t supported, use a serial or I2C connection to communicate with your microcontroller from a similar Lua script as the ones I’ve linked.

There isn’t much of a limit other than the current limit, which is what I suspect you’re reading someplace. Don’t power your strips from the autopilot’s 5V regulator, and you avoid that.

WS2812B

Ah yea the wiring is grand, coming off a powercube.

Whats an I2C?

It’s a hardware communication protocol. Google is your friend there.

If you don’t want to set up byte-wise comms, you can also craft your script to output RC PWM to an otherwise unused servo pin and use your microcontroller to read it. Assign meaning to various pulse widths as you see fit.

These are not RGBW and are indeed directly supported by ArduPilot.