Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- // How many leds are in the strip?
- #define numLeds 144
- #define pin1 10
- #define pin2 11
- #define pin3 9
- #define strip1 65
- #define strip2 62
- #define strip3 17
- // This is an array of leds. One item for each led in your strip.
- CRGB leds[numLeds];
- #define numRows 9
- byte stripLens[numRows] = {3, 9, 14, 18, 21, 23, 22, 19, 15};
- byte stripStart[numRows] = {0, 3, 12, 26, 44, 65, 88, 110, 129};
- // This function sets up the ledsand tells the controller about them
- void setup() {
- // sanity check delay - allows reprogramming if accidently blowing power w/leds
- delay(2000);
- FastLED.addLeds<WS2812B, pin1, GRB>(leds, strip1);
- FastLED.addLeds<WS2812B, pin2, GRB>(leds, strip1, strip2);
- FastLED.addLeds<WS2812B, pin3, GRB>(leds, strip1 + strip2, strip3);
- set_max_power_in_volts_and_milliamps( 5, 3000);
- FastLED.setDither( 0 );
- FastLED.setBrightness(255);
- }
- void setAllColor(CRGB color)
- {
- byte curLed = numLeds;
- while(curLed--)
- {
- leds[curLed] = color;
- }
- }
- void debugBlink (CRGB color)
- {
- setAllColor(color);
- FastLED.show();
- delay(50);
- }
- // This function runs over and over, and is where you do the magic to light
- // your leds.
- void loop() {
- static uint8_t hue = 0;
- debugBlink(CRGB::Red); // flash a color so I can tell which is which
- // this is rock solid
- setAllColor(CRGB::White);
- FastLED.show();
- FastLED.delay(3000);
- debugBlink(CRGB::Blue); // flash a color so I can tell which is which
- // this is rock solid
- setAllColor(CRGB::White);
- FastLED.show();
- delay(3000);
- debugBlink(CRGB::Green); // flash a color so I can tell which is which
- // lots of flickering
- setAllColor(CRGB::White);
- show_at_max_brightness_for_power();
- delay_at_max_brightness_for_power(3000);
- debugBlink(CRGB::Purple); // flash a color so I can tell which is which
- // this is flickering purple
- FastLED.showColor(CRGB::White);
- FastLED.delay(3000);
- }
Advertisement
Add Comment
Please, Sign In to add comment