2022_leds
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 2022_leds [2022/06/03 15:00] – rfhuang | 2022_leds [2023/02/07 23:10] (current) – [LED Wiring] tell | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== LED's ===== | ===== LED's ===== | ||
| - | {{ :: | + | {{ :: |
| __2x Strips of RGB Addressable LED' | __2x Strips of RGB Addressable LED' | ||
| - | \\ The silicone protective layer started to flake off, didn't affect the performance of the LED's | + | \\ The silicone protective layer started to flake off, however |
| **Github** \\ | **Github** \\ | ||
| [[https:// | [[https:// | ||
| - | === LED States === | + | __Cool Wave!__ |
| + | <code java> public void wave(HSVPreset color, double time) { | ||
| + | for (var i = 0; i < buffer.getLength(); | ||
| + | double v = 140 + Math.sin((i - pixelOffset) / (double) buffer.getLength() * Math.PI * 2) * 115; | ||
| + | buffer.setHSV(i, | ||
| + | } | ||
| + | |||
| + | 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**: | **Purple Top-Bottom Animation**: | ||
| + | **Purple Wave Animation**: | ||
| **Solid Alliance Color**: The default state of the LED's, no balls detected and no climbing \\ | **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 \\ | **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 \\ | **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:// | ||
| + | |||
| + | RIO PWM outputs have power, but is not the right power: | ||
| + | |||
| + | So, we need to split the wiring. | ||
| + | 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: | ||
| + | |||
| + | {{ :: | ||
| + | |||
| + | |||
| + | ===== Mutiple strips of LEDs ===== | ||
| + | |||
| + | There are at least two ways to do multiple strips of LEDs: | ||
| + | |||
| + | 1. chain them together. | ||
| + | |||
| + | 2. Wire them in parallel, feeding the same data to both strips. | ||
| + | |||
| + | We used a [[https:// | ||
| + | |||
| + | ===== Where does the +5v power come from ===== | ||
| + | |||
| + | We used the +5v output of a VRM. Its good for 2 amps, which is enough for about 1 meter of a typical 60-LED-per-meter strip. | ||
| + | |||
| + | |||
| + | ===== LED Test Board ===== | ||
| + | |||
| + | We had a short piece of LED strip left over, so we built a little test board. | ||
| + | |||
| + | {{ : | ||
| + | |||
2022_leds.1654282804.txt.gz · Last modified: 2022/06/03 15:00 by rfhuang
