Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // example for setting up two LED strings, each with their own
- // pin and CRGB array to allow a different pattern to run on each.
- #include <FastLED.h>
- #define NUM_LEDS_A 25
- #define NUM_LEDS_B 50
- CRGB ledsA[NUM_LEDS_A];
- CRGB ledsB[NUM_LEDS_B];
- void setup() {
- FastLED.addLeds<WS2812, pinA, RGB>(ledsA, NUM_LEDS_A);
- FastLED.addLeds<WS2812, pinB, RGB>(ledsB, NUM_LEDS_B);
- }
- void loop() {
- //some pattern for A
- EVERY_N_MILLISECONDS(25) {
- for(int i = 0; i < NUM_LEDS_A; i++) {
- static uint8_t hueA;
- ledsA[i] = CHSV(hueA, 200, 200);
- hueA = hueA - 3;
- }
- }
- //some pattern for B
- EVERY_N_MILLISECONDS(42) {
- static unit8_t hueB;
- fill_rainbow( ledsB, NUM_LEDS_B, hueB, 5);
- hueB++;
- }
- FastLED.show(); // update all pixels
- }
RAW Paste Data