3 Betaflight supports the use of addressable LED strips. Addressable LED strips allow each LED in the strip to be programmed with a unique and independent color. This is far more advanced than the normal RGB strips which require that all the LEDs in the strip show the same color.
8 The LED strip feature supports 3 LED strip profiles, STATUS, RACE and BEACON. The selected profile can be changed from the CLI, OSD LED strip menu or from an adjustment channel, i.e. switch on your radio. Take note that the adjustment channel from your radio overrides all other LED strip profile selection options.
13 The STATUS profile is used to display all the information mentioned below, i.e. warning indications, Larson scanner etc.
15 Addressable LED strips can be used to show information from the flight controller system, the current implementation supports the following:
17 * Up to 32 LEDs. (Support for more than 32 LEDs is possible, it just requires additional development.)
18 * Indicators showing pitch/roll stick positions.
19 * Heading/Orientation lights.
20 * Flight mode specific color schemes.
21 * Low battery warning.
22 * AUX operated on/off switch.
30 The RACE profile is used to set ALL strip LEDs to the selected color for racing, i.e. to identify quads based on LED color. The LED color is fixed and no other information is displayed.
35 The BEACON profile is used to find a lost quad, it flashes all LEDs white once per second. Again in this profile no other information is displayed on the LEDs.
38 ### LED Profile Configuration
40 ###### OPTION 1: Configure an adjustment range to change the LED strip profile from your radio
41 1. Turn on Expert mode - see top right of configurator screen "Enable Expert Mode".
42 2. The LED strip profile selection is performed using an adjustment configured via the Adjustments tab.
43 - Enable an adjustment. ("If enabled")
44 - Select the AUX channel to be used to change the LED strip profile. ("when channel")
45 - Set the range to cover the entire range of the selected AUX channel. ("is in ranges")
46 - For the action select "RC Rate Adjustment". ("then apply") This will be configured in the CLI since LED strip profiles is not supported by Configurator 10.4.0 and earlier. "RC Rate Adjustment" is only selected to make the configuration in the CLI a little easier below.
47 - Select the "via channel" to match the selected AUX channel of above. ("when channel").
49 3. Open the CLI and type ```adjrange``` followed by enter.
50 4. Copy the adjrange configured in step 2. above and paste it in the command window. Change the '1' following the range of the channel to '30' and press enter. Type ```save``` and press enter. The configured adjrange will now be saved and the FC will reboot.
51 5. Configure the AUX channel on your radio. When this channel is changed the selected LED strip profile will change between STATUS, RACE and BEACON, you should see the LED function change as you do this.
54 ###### OPTION 2: Use the CLI to select the LED strip profile (i.e. not selecting the LED strip profile with your radio)
56 2. Type ```get ledstrip_profile``` followed by enter to display the currently selected LED strip profile.
57 3. Type ```set ledstrip_profile=x``` where x is the profile STATUS, RACE or BEACON and press enter.
58 4. Type ```save``` followed by enter to save the selected LED strip profile.
61 ###### OPTION 3: By using the OSD
62 1. Open the OSD menu by yawing left and pitching forward on your radio.
63 2. Using the pitch stick, move down to the LED Strip menu and roll right to enter the menu.
64 3. The profile and race color can be configured using the left stick to go back and the right stick to navigate up/down and to change the selected value.
65 4. Use the left stick to go to the top level menu and select save & reboot to complete.
68 ###### RACE COLOR: The Race color can be configured using the CLI:
70 2. Type ```get ledstrip_race_color``` followed by enter to display the currently selected race color number.
71 3. Type ```set ledstrip_race_color=x``` where x is the required color.
72 4. Type ```save``` followed by enter to save the race color to be used.
75 ###### BRIGHTNESS: The brightness can be configured using the CLI:
77 2. Type ```get ledstrip_brightness``` followed by enter to display the current brightness.
78 3. Type ```set ledstrip_brightness=x``` where x is the brightness in percentage between 5 and 100.
79 4. Type ```save``` followed by enter to save the brightness level to be used.
84 Only strips of 32 WS2811/WS2812 LEDs are supported currently. If the strip is longer than 32 LEDs it does not matter, but only the first 32 are used.
86 WS2812 LEDs require an 800khz signal and precise timings and thus requires the use of a dedicated hardware timer.
88 Note: Not all WS2812 ICs use the same timings, some batches use different timings.
90 It could be possible to be able to specify the timings required via CLI if users request it.
94 * [Adafruit NeoPixel Jewel 7](https://www.adafruit.com/products/2226) (preliminary testing)
95 * Measured current consumption in all white mode ~ 350 mA.
96 * Fits well under motors on mini 250 quads.
97 * [Adafruit NeoPixel Stick](https://www.adafruit.com/products/1426) (works well)
98 * Measured current consumption in all white mode ~ 350 mA.
99 * [Aliexpress SK6812 RBGWW strip](https://www.aliexpress.com/wholesale?SearchText=rgbw+sk6812) (works well)
100 * Alternative [Adafruit NeoPixel Stick RGBW](https://www.adafruit.com/product/2869)
105 The [WS2811](https://cdn-shop.adafruit.com/datasheets/WS2811.pdf) is a LED driver IC which is connected to an RGB LED. It accepts data in the form of 8 bits each of Red-Green-Blue.
107 The [WS2812](https://cdn-shop.adafruit.com/datasheets/WS2812.pdf) is integrated into the package of a 50:50 LED rather than as a separate device. It accepts data in the form of 8 bits each of Green-Red-Blue.
109 With the [SK6812](https://cdn-shop.adafruit.com/product-files/1138/SK6812+LED+datasheet+.pdf) also GRBW variants are supported, which have a fourth (white) channel and such provide a much cleaner white color.
111 It is thus possible, depending on the LED board/strip being used that either Red-Green-Blue or Green-Red-Blue encoding may be required. This may be controlled by setting the following.
114 set ledstrip_grb_rgb = RGB
119 set ledstrip_grb_rgb = GRB
124 set ledstrip_grb_rgb = GRBW
127 Then confirm the required setting by simply setting an LED to be green. If it lights up red, you have the wrong setting.
128 Afterwards check if the second LED also lights up red - if not, you might have 4-color SK6812 LEDs and would have to select GRBW.
132 WS2812 LED strips generally require a single data line, 5V and GND.
134 WS2812 LEDs on full brightness can consume quite a bit of current. It is recommended to verify the current draw and ensure your supply can cope with the load. On a multirotor that uses multiple BEC ESC's you can try use a different BEC to the one the FC uses. e.g. ESC1/BEC1 -> FC, ESC2/BEC2 -> LED strip. It's also possible to power one half of the strip from one BEC and the other half from another BEC. Just ensure that the GROUND is the same for all BEC outputs and LEDs.
136 | Target | Pin | LED Strip | Signal |
137 | --------------------- | ---- | --------- | -------|
138 | Naze | RC5 | Data In | PA6 |
139 | CC3D | RCO5 | Data In | PB4 |
140 | ChebuzzF3/F3Discovery | PB8 | Data In | PB8 |
141 | Sparky | PWM5 | Data In | PA6 |
143 Since RC5 is also used for SoftSerial on the Naze it means that you cannot use SoftSerial and led strips at the same time. Additionally, since RC5 is also used for Parallel PWM RC input on both the Naze, Chebuzz and STM32F3Discovery targets, led strips can not be used at the same time at Parallel PWM.
145 If you have LEDs that are intermittent, flicker or show the wrong colors then drop the VIN to less than 4.7v, e.g. by using an inline diode on the VIN to the LED strip. The problem occurs because of the difference in voltage between the data signal and the power signal. The WS2811 LED's require the data signal (Din) to be between 0.3 * Vin (Max) and 0.7 * VIN (Min) to register valid logic low/high signals. The LED pin on the CPU will always be between 0v to ~3.3v, so the Vin should be 4.7v (3.3v / 0.7 = 4.71v). Some LEDs are more tolerant of this than others.
147 The datasheet can be found here: http://www.adafruit.com/datasheets/WS2812.pdf
151 The led strip feature can be configured via the GUI.
154 Enable the Led Strip feature via the GUI under setup.
156 Configure the LEDs from the Led Strip tab in the Betaflight GUI.
157 First setup how the LEDs are laid out so that you can visualize it later as you configure and so the flight controller knows how many LEDs there are available.
159 There is a step by step guide on how to use the GUI to configure the Led Strip feature using the GUI http://blog.oscarliang.net/setup-rgb-led-cleanflight/ which was published early 2015 by Oscar Liang which may or may not be up-to-date by the time you read this.
162 Enable the `LED_STRIP` feature via the cli:
168 If you enable LED_STRIP feature and the feature is turned off again after a reboot then check your config does not conflict with other features, as above.
170 Configure the LEDs using the `led` command.
172 The `led` command takes either zero or two arguments - an zero-based led number and a sequence which indicates pair of coordinates, direction flags and mode flags and a color.
174 If used with zero arguments it prints out the led configuration which can be copied for future reference.
176 Each led is configured using the following template: `x,y:ddd:mmm:cc`
178 `x` and `y` are grid coordinates of a 0 based 16x16 grid, north west is 0,0, south east is 15,15
179 `ddd` specifies the directions, since an led can face in any direction it can have multiple directions. Directions are:
188 For instance, an LED that faces South-east at a 45 degree downwards angle could be configured as `SED`.
190 Note: It is perfectly possible to configure an LED to have all directions `NESWUD` but probably doesn't make sense.
192 `mmm` specifies the modes that should be applied an LED.
194 Each LED has one base function:
197 * `F` - `F`light mode & Orientation
198 * `A` - `A`rmed state.
199 * `R` - `R`ing thrust state.
201 * `S` - R`S`SSI level.
202 * `L` - Battery `L`evel.
204 And each LED has overlays:
208 * `T` - `T`hrust state.
209 * `B` - `B`link (flash twice) mode.
210 * `O` - Lars`O`n Scanner (Cylon Effect).
211 * `V` - `V`TX Frequency.
213 `cc` specifies the color number (0 based index).
227 To erase an led, and to mark the end of the chain, use `0,0::` as the second argument, like this:
233 It is best to erase all LEDs that you do not have connected.
239 This mode simply uses the LEDs to flash when warnings occur.
241 | Warning | LED Pattern | Notes |
242 |---------|-------------|-------|
243 | Arm-lock enabled | flash between green and off | occurs during calibration or when unarmed and the aircraft is tilted too much |
244 | Low Battery | flash red and off | battery monitoring must be enabled. May trigger temporarily under high-throttle due to voltage drop |
245 | Failsafe | flash between light blue and yellow | Failsafe must be enabled |
247 Flash patterns appear in order, so that it's clear which warnings are enabled.
251 This mode shows the GPS state and satellite count.
256 The LEDs will blink as many times as the satellite count, then pause and start again.
260 This mode binds the LED color to RSSI level.
263 | ---------- | ---------|
271 When RSSI is below 50% is reached, LEDs will blink slowly, and they will blink fast when under 20%.
276 This mode binds the LED color to remaining battery capacity.
279 | ---------- | ---------|
287 When Warning or Critical voltage is reached, LEDs will blink slowly or fast.
288 Note: this mode requires a current sensor. If you don't have the actual device you can set up a virtual current sensor (see [Battery](Battery.md)).
292 This mode blinks the current LED, alternatively from black to the current active color.
294 #### Larson Scanner (Cylon Effect)
296 The Larson Scanner replicates the scanning "eye" effect seen on the mechanical Cylons and on Kitt from Knight Rider.
297 This overlay dims all of the LEDs it is assigned to and brightens certain ones at certain times in accordance with the animation. The animation is active regardless of arm state.
301 This overlay makes the LED color dependent on the current channel of the VTX, in case it is equipped with SmartAudio or IRC Tramp.
302 The color is selected according to the following table:
304 Frequency range | Default color | Color index
307 |> 5672 <= 5711 | Red | 2
308 |> 5711 <= 5750 | Orange | 3
309 |> 5750 <= 5789 | Yellow | 4
310 |> 5789 <= 5829 | Green | 6
311 |> 5829 <= 5867 | Blue | 10
312 |> 5867 <= 5906 | Dark violet | 11
313 |> 5906 | Deep pink | 13
315 The default color can be changed by double-clicking the color and moving the Hue slider or by using the color command in the CLI.
317 #### Flight Mode & Orientation
319 This mode shows the flight mode and orientation.
321 When flight modes are active then the LEDs are updated to show different colors depending on the mode, placement on the grid and direction.
323 LEDs are set in a specific order:
324 * LEDs that marked as facing up or down.
325 * LEDs that marked as facing west or east AND are on the west or east side of the grid.
326 * LEDs that marked as facing north or south AND are on the north or south side of the grid.
328 That is, south facing LEDs have priority.
330 The mapping between modes led placement and colors is currently fixed and cannot be changed.
334 This mode flashes LEDs that correspond to roll and pitch stick positions. i.e. they indicate the direction the craft is going to turn.
336 | Mode | Direction | LED Color |
337 |------------|--------|---------------------|
338 |Orientation | North | WHITE |
339 |Orientation | East | DARK VIOLET |
340 |Orientation | South | RED |
341 |Orientation | West | DEEP PINK |
342 |Orientation | Up | BLUE |
343 |Orientation | Down | ORANGE |
345 |Head Free | North | LIME GREEN |
346 |Head Free | East | DARK VIOLET |
347 |Head Free | South | ORANGE |
348 |Head Free | West | DEEP PINK |
349 |Head Free | Up | BLUE |
350 |Head Free | Down | ORANGE |
352 |Horizon | North | BLUE |
353 |Horizon | East | DARK VIOLET |
354 |Horizon | South | YELLOW |
355 |Horizon | West | DEEP PINK |
356 |Horizon | Up | BLUE |
357 |Horizon | Down | ORANGE |
359 |Angle | North | CYAN |
360 |Angle | East | DARK VIOLET |
361 |Angle | South | YELLOW |
362 |Angle | West | DEEP PINK |
364 |Angle | Down | ORANGE |
366 |Mag | North | MINT GREEN |
367 |Mag | East | DARK VIOLET |
368 |Mag | South | ORANGE |
369 |Mag | West | DEEP PINK |
371 |Mag | Down | ORANGE |
373 |Baro | North | LIGHT BLUE |
374 |Baro | East | DARK VIOLET |
375 |Baro | South | RED |
376 |Baro | West | DEEP PINK |
378 |Baro | Down | ORANGE |
382 This mode toggles LEDs between green and blue when disarmed and armed, respectively.
384 Note: Armed State cannot be used with Flight Mode.
388 This mode fades the current LED color to the previous/next color in the HSB color space depending on throttle stick position. When the throttle is in the middle position the color is unaffected, thus it can be mixed with orientation colors to indicate orientation and throttle at the same time. Thrust should normally be combined with Color or Mode/Orientation.
390 #### Thrust ring state
392 This mode is allows you to use one or multiple led rings (e.g. NeoPixel ring) for an afterburner effect. LEDs with this mode will light up with their assigned color in a repeating sequence. Assigning the color black to an LED with the ring mode will prevent the LED from lighting up.
394 A better effect is achieved when LEDs configured for thrust ring have no other functions.
396 LED direction and X/Y positions are irrelevant for thrust ring LED state. The order of the LEDs that have the state determines how the LED behaves, and the throttle value determines the animation rate. The animation is only active while armed.
398 Each LED of the ring can be a different color. The color can be selected between the 16 colors available.
400 For example, led 0 is set as a `R`ing thrust state led in color 13 as follow.
406 LED strips and rings can be combined.
410 The mode allows you to set an LED to be permanently on and set to a specific color.
412 x,y position and directions are ignored when using this mode.
414 Other modes will override or combine with the color mode.
416 For example, to set led 0 to always use color 10 you would issue this command.
424 Colors can be configured using the cli `color` command.
426 The `color` command takes either zero or two arguments - an zero-based color number and a sequence which indicates pair of hue, saturation and value (HSV).
428 See http://en.wikipedia.org/wiki/HSL_and_HSV
430 If used with zero arguments it prints out the color configuration which can be copied for future reference.
432 The default color configuration is as follows:
435 | ----- | ----------- |
472 ### Mode Colors Assignement
474 Mode Colors can be configured using the cli `mode_color` command.
476 - No arguments: lists all mode colors
477 - arguments: mode, function, color
479 First 8 groups of ModeIndexes are :
482 |------|-------------|
492 Modes 0 to 5 functions:
503 Mode 6 use these functions:
506 |----------|--------------------|
511 | 4 | blink background |
512 | 5 | gps: no satellites |
516 The ColorIndex is picked from the colors array ("palette").
518 Mode 7 is used along with Thrust state to make the LED color dependent on a channel different from the throttle.
520 Examples (using the default colors):
522 - set armed color to red: ```mode_color 6 1 2```
523 - set disarmed color to yellow: ```mode_color 6 0 4```
524 - set Headfree mode 'south' to Cyan: ```mode_color 1 2 8```
525 - set color dependent on AUX 1 in Thrust state: ```mode_color 7 0 4```
529 Cut the strip into sections as per diagrams below. When the strips are cut ensure you reconnect each output to each input with cable where the break is made. e.g. connect 5V out to 5V in, GND to GND and Data Out to Data In.
531 Orientation is when viewed with the front of the aircraft facing away from you and viewed from above.
533 ### Example 12 LED config
535 The default configuration is as follows
571 Which translates into the following positions:
586 LEDs 0,3,6 and 9 should be placed underneath the quad, facing downwards.
587 LEDs 1-2, 4-5, 7-8 and 10-11 should be positioned so the face east/north/west/south, respectively.
588 LEDs 12-13 should be placed facing down, in the middle
589 LEDs 14-15 should be placed facing up, in the middle
590 LEDs 16-27 should be placed in a ring and positioned at the rear facing south.
592 This is the default so that if you don't want to place LEDs top and bottom in the middle just connect the first 12 LEDs.
594 ### Example 16 LED config
615 Which translates into the following positions:
629 LEDs 0,3,6 and 9 should be placed underneath the quad, facing downwards.
630 LEDs 1-2, 4-5, 7-8 and 10-11 should be positioned so the face east/north/west/south, respectively.
631 LEDs 12-13 should be placed facing down, in the middle
632 LEDs 14-15 should be placed facing up, in the middle
634 ### Example 28 LED config
644 # right front cluster
651 # center front cluster
683 All LEDs should face outwards from the chassis in this configuration.
686 This configuration is specifically designed for the [Alien Spider AQ50D PRO 250mm frame](http://www.goodluckbuy.com/alien-spider-aq50d-pro-250mm-mini-quadcopter-carbon-fiber-micro-multicopter-frame.html).
691 On initial power up the LEDs on the strip will be set to WHITE. This means you can attach a current meter to verify the current draw if your measurement equipment is fast enough. Most 5050 LEDs will draw 0.3 Watts a piece.
692 This also means that you can make sure that each R,G and B LED in each LED module on the strip is also functioning. After a short delay the LEDs will show the unarmed color sequence and or low-battery warning sequence.
694 Also check that the feature `LED_STRIP` was correctly enabled and that it does not conflict with other features, as above.
697 ## Resource remapping
699 If your board does not have a physical LED_STRIP pin you still can use this feature but configuration is dependend on target resources.
701 An example for a Foxeer F745V3_AIO board using SERIAL_RX 1 as LED_STRIP:
703 resource SERIAL_RX 1 A10
704 resource SERIAL_RX 1 NONE
705 resource LED_STRIP 1 A10
706 timer show # show current timer list
707 timer A10 list # check available timers for next commmand
709 dma show # show current dma list
710 dma pin A10 list # check available dma pins for next command