Skip to content
Open
Changes from 41 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
455e723
Revise addressable LEDs documentation for clarity
Another-Person1 Dec 15, 2025
4581a74
Apply suggestions from code review
Another-Person1 Dec 15, 2025
0b528a2
Apply suggestions from docs review
Another-Person1 Dec 15, 2025
2d04c46
Apply suggestions from docs review
Another-Person1 Dec 21, 2025
ed9e326
Apply suggestions from docs review
Another-Person1 Dec 23, 2025
bfb4496
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
646d3dd
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
bf9b975
Apply suggestions from docs review
Another-Person1 Dec 23, 2025
5411d96
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
fc96c5d
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
75fda75
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
dd14cc5
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
c6d969f
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
d0cc195
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
3dabdab
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
e0c5613
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
b027e55
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
cc855b8
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
c84f31b
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
7ab4845
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
20ee4f8
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
f5e4333
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
abd05ec
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
24aa6ea
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
dd5f467
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
e8ed7b1
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
bbd9135
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
85d324a
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
68cdb8d
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
3e3d762
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
11828c3
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
317b024
Apply suggestion from @Another-Person1
Another-Person1 Dec 23, 2025
41aa9ea
Fix docs
Another-Person1 Dec 23, 2025
5610467
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
9c7a6a4
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
a269713
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 23, 2025
a5741d7
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Dec 24, 2025
7478f86
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Jan 4, 2026
a11134d
Update source/docs/software/hardware-apis/misc/addressable-leds.rst
Another-Person1 Jan 4, 2026
0d0b021
updated the addressable LEDs documentation
Another-Person1 Feb 22, 2026
2fef28b
made LED timings collapsible and added note recommending against VRM
Another-Person1 Feb 22, 2026
393fb60
added resistance note and fixed some stuff, improved wording as well
Another-Person1 Feb 26, 2026
d7b5ca4
fixed rst hopefully
Another-Person1 Feb 27, 2026
44660f1
fixing stuff
Another-Person1 Feb 27, 2026
118a766
fixing build tool errors
Another-Person1 Mar 2, 2026
b8f639c
edited some things
Another-Person1 Mar 2, 2026
5ee5d69
changed instantiating example to reflect smart io port
Another-Person1 Mar 2, 2026
f52730b
implemented feedback
Another-Person1 Mar 3, 2026
2fcd6fa
removed ambigious character
Another-Person1 Mar 3, 2026
98aa321
fixed headings and other things
Another-Person1 Mar 3, 2026
91b9629
fixed redirect error
Another-Person1 Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions source/docs/software/hardware-apis/misc/addressable-leds.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
# Addressable LEDs

LED strips have been commonly used by teams for several years for a variety of reasons. They allow teams to debug robot functionality from the audience, provide a visual marker for their robot, and can simply add some visual appeal. WPILib has an API for controlling WS2812, WS2812B, and WS2815 LEDs with their data pin connected via :term:`PWM`.
Addressable LEDs are widely used by teams for debugging, visual markers, and aesthetic appeal.

.. note:: LEDs can be controlled through this API while the robot is disabled.
WPILib provides an API for controlling WS2811, WS2812B, SK6812, and similar LEDs connected to the SIGNAL pin of a SMART I/O connector and without the need an external LED controller.

.. important:: The roboRIO can only control **one** ``AddressableLED`` object at a time through its PWM ports. Attempting to create multiple ``AddressableLED`` objects will result in a HAL allocation error. If you need to control multiple physical LED strips, you have several options:
These LEDs, often called NeoPixels, can be controlled even when the robot is disabled.

- **Daisy-chain strips in series**: Connect multiple LED strips end-to-end as a single long strip, then use :ref:`buffer views <docs/software/hardware-apis/misc/addressable-leds:Controlling Sections of an LED Strip>` to control different sections independently
- **Use PWM Y-cables**: If you need identical patterns on multiple strips, use PWM Y-cables to send the same signal to multiple strips simultaneously
.. note:: This library supports only WS2812B-compliant LEDs. LEDs that do not follow the below timings may not work correctly. For example, WS2815 & DotStar LEDs are not supported.

.. seealso:: For detailed information about powering and best practices for addressable LEDs, see the [Adafruit NeoPixel Überguide](https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels).
.. collapse:: Timing details

.. warning:: WS2812B LEDs are designed for 5V, but roboRIO PWM/Servo ports output 6V. While the LEDs will function, this may reduce their lifespan. Consider using a voltage regulator or level shifter if longevity is a concern.
- T0H: 375ns
- T0L: 875ns
- T1H: 750ns
- T1L: 500ns

.. important:: Systemcore supports multiple addressable LED products simultaneously, unlike the roboRIO, and allows LED control while the robot is disabled.

.. seealso:: For more detailed information about powering and best practices for addressable LEDs, see the [Adafruit NeoPixel Überguide](https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels).

.. note:: **Power and Signal Considerations**

- WS281x LEDs are designed for **5V**, but Systemcore ports output **3.3V**. A logic level shifter, like the [Adafruit Pixel Shifter](https://www.adafruit.com/product/6066), is necessary if there is flickering or incorrect behavior.
- Use a **good-quality appropriately sized external 5V regulator** (e.g. [Redux Zinc-V+](https://shop.reduxrobotics.com/products/zinc-v) or [Pololu S13VxF5](https://www.pololu.com/product/4082)) to power the LEDs, ensuring the grounds are tied together.
- The [CTRE VRM 5V output](https://store.ctr-electronics.com/products/voltage-regulator-module) is not recommended for new purchases as it can only supply 2A in total across both 5V channels, so it is only suitable for lower quantities of pixels.
- If you have a lot of LEDs, a 300-500 Ohm data line resistor and a 1000μF capacitor across the power pins are recommended. Power may need to be [distributed throughout the strip](https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels#distributing-power-2894492).

## Instantiating the AddressableLED Object

You first create an ``AddressableLED`` object that takes the PWM port as an argument. It *must* be a PWM header on the roboRIO. Then you set the number of LEDs located on your LED strip, which can be done with the ``setLength()`` function.
You first create an ``AddressableLED`` object that takes the SMART I/O port as an argument. Then you set the number of LEDs that are connected, which can be done with the ``setLength()`` function.

.. warning:: It is important to note that setting the length of the LED header is an expensive task and it's **not** recommended to run this periodically.

After the length of the strip has been set, you'll have to create an ``AddressableLEDBuffer`` object that takes the number of LEDs as an input. You'll then call ``myAddressableLed.setData(myAddressableLEDBuffer)`` to set the led output data. Finally, you can call ``myAddressableLed.start()`` to write the output continuously. Below is a full example of the initialization process.
After the length of the strip has been set, you'll have to create an ``AddressableLEDBuffer`` object that takes the number of LEDs as an input. You'll then call ``myAddressableLed.setData(myAddressableLEDBuffer)`` to set the LED output data. Finally, you can call ``myAddressableLed.start()`` to write the output continuously. Below is a full example of the initialization process.

.. note:: C++ does not have an AddressableLEDBuffer, and instead uses an Array.

Expand Down Expand Up @@ -49,7 +62,7 @@ After the length of the strip has been set, you'll have to create an ``Addressab

## Controlling Sections of an LED Strip

The roboRIO can only control a single addressable LED output at a time, but there are often multiple physical LED strips daisy-chained around a robot, or a single flexible LED strip wrapped around structures on a robot. Individual sections can be accessed in Java using ``AddressableLEDBufferView``. Buffer views behave like subsections of the larger buffer, and can be accessed using indices in the typical [0, length) range. They can also be reversed, to allow for parallel serpentine sections to be animated in the same physical orientation (i.e. both sections would animate "forward" in the same direction, even if the strips are physically tip-to-tail).
Individual sections can be accessed in Java using ``AddressableLEDBufferView``. Buffer views behave like subsections of the larger buffer, and can be accessed using indices in the typical [0, length) range. They can also be reversed, to allow for parallel serpentine sections to be animated in the same physical orientation (i.e. both sections would animate "forward" in the same direction, even if the strips are physically tip-to-tail).

.. tab-set::

Expand Down Expand Up @@ -973,7 +986,7 @@ Blends will combine the output colors of patterns together, by averaging out the

``LEDPattern`` is an easy and convenient way of controlling LEDs, but direct access to the LED colors is sometimes needed for custom patterns and animations.

Color can be set to an individual led on the strip using two methods: ``setRGB()``, which takes RGB values as an input, and ``setHSV()``, which takes HSV values as an input. Low-level access is typically done with an indexed for-loop that iterates over each LED index of the section to control. This method can be used for both ``AddressableLEDBuffer`` and ``AddressableLEDBufferView`` objects in Java, and for ``std::span`` for C++.
Color can be set to an individual LED on the strip using two methods: ``setRGB()``, which takes RGB values as an input, and ``setHSV()``, which takes HSV values as an input. Low-level access is typically done with an indexed for-loop that iterates over each LED index of the section to control. This method can be used for both ``AddressableLEDBuffer`` and ``AddressableLEDBufferView`` objects in Java, and for ``std::span`` for C++.

.. note:: RGB stands for Red, Green, and Blue. This is a fairly common color model as it's quite easy to understand, and it corresponds with a typical LED configuration that's comprised of one red, one green, and one blue sub-LED. LEDs can be set with the ``setRGB`` method that takes 4 arguments: index of the LED, amount of red, amount of green, amount of blue. The amount of red, green, and blue are integer values between 0-255.

Expand Down Expand Up @@ -1048,4 +1061,4 @@ These examples demonstrate setting an entire LED strip to solid red using the RG
}
})
});
</script>
</script>