Skip to content

LEDController

Initializes the LED controller.

:param pwm_port: The PWM port the LED strip is connected to. :param length: Number of LEDs in the strip.

Applies a wpilib.LEDPattern to the LED buffer and updates the strip.

Sets the entire LED strip to a solid color.

Sets the color of a single LED pixel.

Custom preset that Sets a gradient from start_color to end_color across the LED strip.

Custom preset that Creates a rainbow effect across the LED strip.

The offset parameter (in degrees) can be used to animate the rainbow.

Custom preset that Creates a rainbow effect across the LED strip.

The offset parameter (in degrees) can be used to animate the rainbow.

Moves a block of LEDs across the strip using RobotController.getTime() for timing.

Moves a fixed-size multicolor block across the strip using RobotController.getTime() for timing.

Blinks the entire strip between two colors at the given frequency.

:param color1: The first RGB color. :param color2: The second RGB color. Defaults to off (0, 0, 0). :param hertz: Blink frequency in Hz (full cycles per second). Default is 2 Hz.

Turns off all LEDs.