0

So, I have an RGB matrix (using PL9823 LEDs) that's 32 x 8 that I'm trying to run a circular spinning rainbow pattern across in a continuous loop. Now, there's lots of code online for different ways to do this with a traditional daisy chained matrix, but I have mine set up to where each of the 8 rows of LEDs goes to a different pin on my Teensy 3.2 controller (pins 4-11) and I have no idea how to get this (or any) rainbow effect working on it. I'm using the FastLED library and this is how I have the program set up to address individual pins as the different rows of LEDs:

#include "FastLED.h"
#define LED_TYPE PL9823
#define NUM_STRIPS 8
#define NUM_LEDS_PER_STRIP 64
#define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS

#define COLOR_ORDER GRB

uint8_t hue = 0;

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
CRGB row_1[64];
CRGB row_2[64];
CRGB row_3[64];
CRGB row_4[64];
CRGB row_5[64];
CRGB row_6[64];
CRGB row_7[64];
CRGB row_8[64];

void setup() {
  FastLED.addLeds<PL9823, 4>(row_1, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 5>(row_2, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 6>(row_3, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 7>(row_4, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 8>(row_5, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 9>(row_6, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 10>(row_7, 0, NUM_LEDS_PER_STRIP);
  FastLED.addLeds<PL9823, 11>(row_8, 0, NUM_LEDS_PER_STRIP);

}

Does anyone know how I can make this setup run a spinning wheel of fading color values in the form of a spinning rainbow? I'm hoping to use suggestions as a place to start to build other patterns with and without rainbows as well and I'm a bit of a noob, so an explanation is appreciated.

  • why don't you start with basics and learn how to display a simple monochrome circle – jsotola Mar 7 at 2:16
  • why are you using a separate data pin for each row? – jsotola Mar 7 at 2:17
  • The display is set up as such that the rows cannot be daisy chained and all the inputs are on on side – Niek Mar 7 at 3:07
  • Also, I am able to address individual LEDs on the matrix, set their color, and move them more or less by building frames one LED at a time. – Niek Mar 7 at 3:21
  • that kind of setup is unlikely to have easy, built-in support with existing libraries, since all the animation call would be broken up 8 ways. can't you wrap the data lines around? – dandavis Mar 7 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.