I have been working non-stop for a week now trying to figure out how

I have been working non-stop for a week now trying to figure out how to do the following with my xmas lights setup like the attached image shows.
I would like to fade from black to red on column1 row1, which is on Pin9, Pixel#49-40 then onto column2 row1, which is on Pin10, Pixel#0-9 fading from black to green, and then column3 row1, which is on Pin11, Pixel#0-9, fading from black to red and then have it move down to Column3, row2, which is on Pin11, Pixel#10-19 having it fade from black to green, and then move again to Column2, row2, Pin10, Pixel#10-19, and so on.
Sorry for the Newbie questions, as I have looked everywhere and tried to set pixels individually with no luck :-(.

I am using 3 - NeoPixel WS2812B strips that are 50 Pixels in length.

Thank you in advance,
Scott

Here’s a rough draft of how you would address your pixels - assuming you could overlay an X/Y grid on top of your three columns (with y=0, x=0 being the upper left corner of your drawing and y=4, x=29 being the lower right):

#define NUM_LEDS_PER_STRIP 50
#define NUM_STRIPS 3
#define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS

#define COL_WIDTH 10
#define NUM_ROWS 5
CRGB leds[NUM_LEDS];

int XY(uint8_t x, uint8_t y) {
// determine what column we’re in
uint16_t base = 0;
if(x >= 10) base += NUM_LEDS_PER_STRIP;
if(x >= 20) base += NUM_LEDS_PER_STRIP;

// reduce x to the position in the specific column
x %= 10;

// columns B & C are wired the same
if(base > 0) {
if(y & 0x01) {
// odd rows, reverse the ordering
uint8_t rx = (COL_WIDTH - 1) - x;
base += ((yCOL_WIDTH) + rx);
} else {
base += ((y
COL_WIDTH) + x);
}
} else {
// column A is upside down, making this trickier
uint8_t ry = (NUM_ROWS-1) - y;
if(ry & 0x01) {
base += ((ryCOL_WIDTH)+x;
} else {
uint8_t rx = (COL_WIDTH-1) -x ;
base += ((ry
COL_WIDTH)+rx;
}
}

return base;
}

setup() {
FastLED.addLeds<WS2812B, 9>(leds, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812B, 10>(leds + NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<WS2812B, 11>(leds + (2*NUM_LEDS_PER_STRIP), NUM_LEDS_PER_STRIP);
}

void loop() {
for(int y = 0; y < NUM_ROWS; y++) {
for(int x = 0; x < COL_WIDTH*NUM_STRIPS; x++ ) {
leds[XY(x,y)] = CRGB::Red;
FastLED.show();
leds[XY(x,y)] = CRGB::Black;
}
}
}

From here then, you can just work in terms of X/Y’s like you were drawing on a grid.

Thank you sooooo much. It’s amazing that I have been working on this for a while and it takes you a couple of minutes to reply with a solution. I will let you know how it goes.
Thanks again Daniel

Thank you again for posting the code for the xmas lights, lol I’m still trying to figure out how to set every other 3 pixels green, but I forgot to also ask if there is a way to select multiple Pixels, for example, pix1,pix4,pix6,pix9 and then be able to utilize them later as a variable?

@Scott_S Hi Scott,
you could define them in an array. A quick example:

This one defines an array with 2 “groups” of 5 values each:

byte myGroups[2][5] = {
{ 12, 13, 14, 15, 16 }, // LEDs 12 to 16
{ 17, 21, 25, 39, 41 }
};

Later on you can assign colors to one of these “groups” by using a void like this:

void showGroup(byte groupID, byte color) {
for (i = 0; i < 5; i++) {
leds[myGroups[groupID][i].setHSV(color, 255, 150);
}
}

This would be used like this:

showGroup(0, 64);
FastLED.show();

This would set the leds 12 - 16 to yellow and turn them on.

Hope this helps,
Daniel

Yes, very much so. Thanks again. Once I get this thing 100%, I will post video and finished code.

So as promised, here is my long hand code, as I always seem to bypass simplistic coding… http://pastebin.com/3WSwq5Vp
I know, I am terrible at coding, but most of the time it works lol. Now, I just need to get some extra things done like fading and such.