What I'm trying to do is, I make multiple arrays that store the brightness of each Leds. They are like sprites for an animation. Then I would cycle through the values of each set of arrays for each 'frame' of led animation.
So what I'm trying is:
Say, I want to make an alternating pattern with leds like christmas lights.
I was thinking of making multiple arrays (this is just an example)
{50, 0, 50, 0, 50, 0, 50}
{0, 50, 0, 50, 0, 50, 0}
{100, 0, 100, 0, 100, 0}
{60, 70, 30, 60, 70, 30}
like so, then cycle those values across an led strip with 7 leds to animate.
This one would be making leds brighter. (still just a crude example)
{0, 0, 0, 0, 0, 0, 0}
{20, 20, 20, 20, 20, 20, 20}
{100, 100, 100, 100, 100, 100}
{255, 255, 255, 255, 255, 255}
Here's what I have and it compiles fine but when I do a test Serial.print of one of value in the array, nothing shows up. LED strip doesn't work either.
#include "FastSPI_LED2.h"
#define NUM_LEDS 24
#define DATA_PIN 12
CRGB leds[NUM_LEDS];
uint8_t valarray[100][NUM_LEDS];
void setup()
{
delay(2000);
LEDS.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
Serial.begin(9600);
for(uint8_t i=0;i<100;i++){
for(uint8_t j=0;j<NUM_LEDS;j++){
valarray[i][j] = i;
}
}
}
void loop()
{
for(uint8_t i=0;i<100;i++){
for(uint8_t j=0;j<NUM_LEDS;j++){
leds[j]=CHSV(0,255,valarray[i][j];
}
LEDS.show();
}
delay(10);
}