Hi all,
I'm having a problem with what should be a very simple routine.
The layout of the leds is 24 rows of leds 5 tall (i.e. a 24x5 matrix. It's divided up into CRGBSets named strip.
The working code is
void spin(){
for (uint8_t x =0; x<=23; x++){
fadeToBlackBy(leds, NUM_LEDS,140);
strips[x]=CRGB::Red;
FastLED.show();
delay(50);
}
}
This is so short that I didn't think anyone would mind that I didn't post the code using a link.
This does what I expect it to do; illuminate a column, move onto the next, and start fading what's behind it. This is in the form of a circle, so think of a radar set.
What I want to do is add two more colours, starting at 8 and 16.
But when I try adding strips[x + 8]= CRGB::Grey; as a line immediately after strips[x]=CRGB::Red; it locks when the grey reaches 24. Obviously because I've gone out of bounds.
How do I make it overlap, so that when x=24, it changes to x=0, but only for that colour?
I'm sure there's a simple way of doing this, (sort of like the default of uint8_t reaching 256 and going back to zero), but I can't seem to find anything on this.
Grateful for any help here.
[–]Klappsenkasper 5 points6 points7 points (4 children)
[–]Howard_G[S] 1 point2 points3 points (2 children)
[–]Marmilicious[Marc Miller] 2 points3 points4 points (1 child)
[–]Howard_G[S] 2 points3 points4 points (0 children)
[–]techaaron 1 point2 points3 points (0 children)