Position light as pre-arm indicator

While browsing through the LUA example scripts, I was fascinated by the script from Mirko Denecke @mirkix (ardupilot/LED_poslight.lua at master · ArduPilot/ardupilot · GitHub) , which controls the RGB LED strips simultaneously as position lights and strobe lights, the latter indicating an armed status.

Waiting for sufficient GPS reception and setting the origin sometimes takes a while. In order not to always have to stare at the telemetry screen while waiting, I have extended the script a bit to be able to display the progress of the GPS reception out of the corner of your eye.
I am placing a LED chain with 6-8 Leds:

  • The first 2 navigation LEDs switched on means less than 4 satellites, 4 green/red LEDs switched on means up to 6 satellites. All LEDS switched on means more then 6 satellites.
  • Once Origin is set, all white Strobelights flashes on time every 1.5 seconds to indicate that vehicle is able to arm with active EKF3.
  • Doubleflash 1/second means vehicle is armed.

Due to the different brightness of the red and green LEDs, the brightness can be adjusted separately for red and green.

LED.lua (3.5 KB)



There is a rather poorly documented binding that will allow you to get the notify LED color as well:
local r, g, b = LED:get_rgb()

So, if you wanted your strobe lights to mimic the built-in LED (when disarmed, for example), that might prove useful.

1 Like