This is an old revision of the document!
Table of Contents
LED's
2x Strips of RGB Addressable LED's
The silicone protective layer started to flake off, however didn't affect the performance of the LED's
Github
LED.java
Cool Wave!
public void wave(HSVPreset color, double time) { for (var i = 0; i < buffer.getLength(); i++) { double v = 140 + Math.sin((i - pixelOffset) / (double) buffer.getLength() * Math.PI * 2) * 115; buffer.setHSV(i, color.h, color.v, (int) v); } if (timer.get() < time) { if (pixelOffset == buffer.getLength() - 1) { pixelOffset = 0; } } else { pixelOffset += 1; timer.reset(); } led.setData(buffer); led.start(); }
LED States
Purple Top-Bottom Animation: Indicates the shooter RPM's, solid purple when up to speed
Purple Wave Animation: Indicates that the climber is active and is moving up or down
Solid Alliance Color: The default state of the LED's, no balls detected and no climbing
Half Green: Indicates that a ball is in the top position of the tower
Full Green: Indicates that two balls are in their positions in the tower
LED Wiring
These LED strips have three wires:
- +5v Power
- Data stream (controls the colors)
- Ground - common return for data and power
The data stream comes from a RoboRIO PWM output, as described here https://docs.wpilib.org/en/stable/docs/software/hardware-apis/misc/addressable-leds.html
RIO PWM outputs have power, but is not the right power: PWMs have 6 volt power, intended for servo motors. It might not kill the LEDs immediately, but might reduce their lifetime a lot. And the RoboRIO can't supply enough current for a long string of LEDs anyway.
So, we need to split the wiring. Power comes in on two wires, red for power and black for ground. and we use a seperate scrap of a PWM cable for data. The center red wire of the PWM cable is not used, only black (ground) and white (data).
Here's a sketch of which wires go where:
and here's a picture of one assembled:




