FlAME SUIT ON. Ill do my best to be quick to the point.

FlAME SUIT ON. Ill do my best to be quick to the point.

Hello all,

Bit of background: mechanically inclined individual who mostly builds cars and home upkeep projects(Bathrooms,kitchens,deck repair…simple things ect) By trade i am a CAD designer.

Task:

I’ve taken on a project that requires a bit of LED coding and i’ve done a fair amount of research or what I consider fair.

I’ve done a lot of the tutorials and such related to the the FAStled Library and their XY matrix but still haven’t quiet found what im looking for. Digging through the example file im just not finding what im looking for or its quiet possible its right in front of me but Im just doing it wrong.

I really just need to make a grid and have 3 leds chase or run the path it is on.

For a hypothetical example the grid will look like this( using bits of code to outline the environment im working with I understand it wont work to control anything at this time)

#define COLOR_ORDER GRB
#define CHIPSET WS2811 // strip

const uint8_t kMatrixWidth = 27;
const uint8_t kMatrixHeight = 15;

//
// 0 > 1 > 2 > 3 > 4
// |
// |
// 9 < 8 < 7 < 6 < 5
// |
// |
// 10 > 11 > 12 > 13 > 14
// |
// |
// 19 < 18 < 17 < 16 < 15

Im looking to command individual rows of the leds to just chase down until it ends then start over at the first led of the row it started.

Im not asking for someone to do it for me. Does anyone know of a tutorial video, website to get me started on controlling individual leds BEYOND the provided example file for the XY MAtRIX

Ei Commanding X1, Y4 led to turn on and shut off for a certain time.

I understand google is your friend, and x amount of research could possibly yield the direction im looking for but for the first time in a while google has not been my friend, and ive been looking for a few days now.

It might be worth looking at the fridge post below, I can’t remember if they shared the code but I seem to remember that it had a snake running on an LED matrix…

Are all of the LEDs wired together in one strip or are there multiple strips? I have an idea of how this can be accomplished but it depends on how they are wired and possibly even eliminating the XY matrix code.

Sorry I just reread your post. It looks like you will have the LEDs setup in a snake/serpentine layout. Is the 27 width and 15 height accurate? I’ll see if I can write something up to test my idea.

Ok. The few snake videos I’ve found have been just a display that a game outputs. But thank you for the feed back I’ll 100% look into it.

being a newbie, I would do it the long, hard clunky way…

the coding “grammar” is probably wrong, but I’m at work and can’t test it for mistakes…

void loop()
{
for(int i = 0; i < 5; i++) //identifies LEDs 0 to 4
{
leds[i] = CHSV(96, 255, 255); //turns them green

FastLED.show(); // shows them
leds[i] = CHSV(96, 255, 0); // gets ready to turn them
//off next FastLED.show();
delay (1000); // waits
}
for(int i = 5; i < 10; i++) //identifies LEDs 5 to 9
{
leds[i] = CHSV(96, 255, 255); //turns them green

FastLED.show();// shows them and turns off LEDs 0 to 4
leds[i] = CHSV(96, 255, 0); // gets ready to turn them
//off next FastLED.show();
delay (1000); // waits
}
// etc etc
}

I’ve re-read this a few times and if the LEDs are wired in sequence like you’ve described, I’m not sure why you’d want to think of them as a matrix. All you’re doing is iterating a 3-pixel line down the length until it gets back to 0. Should be a simple for statement (unless I’m completely misunderstanding the intention):

int tailSize = 2;
int lastLED = 15;

loop(){
for( int i=0; i<=lastLED+tailSize; i++ ){
//if statement used to ensure it doesn’t display past the length specified, but allow ‘tail’ to continue being drawn;
if( i<lastLED) strip.setPixelColor(i, 255, 0 ,0);
for (int j=1; j<=tailSize; j++){
if(i-j<16) strip.setPixelColor(i-j, 128, 0, 0);
}
}
}

I haven’t actually tested this, but assuming the syntax is sound, I’m pretty sure the logic works.

Typing a clear response will be hard on a phone but I’ll try.

The LEDs are going Inside of a clear cylinder.

The clear cylinder will have eyes and a mouth and be warn as a helmet.

The reason I felt I need a matrix was I need to work around the eyes and mouth while maintaining even rows chasing in the pattern.

I’ll get an image of the project shortly.

I am also under the impression that if I want to display an image/shape let’s say on the side of the head. I’d need a matrix with old school pixelated Mario growing. Just future proofing the project so as I learn the coding I would be required to re-live the whole thing.

I think I fubar’d that code. Lemme get back to you.

I was looking at this RGB shades project that seems like I might be able to snag some code from it or best case practice more.

missing/deleted image from Google+

A rough idea of the look there will be rows above and below the ones shown.

I guess being the noob that am I felt a matrix was the best way to about this due to the missing LEDs where the eyes and mouth will be

The LEDs will all be connected on the back of the “head” and shining out.
missing/deleted image from Google+

My idea won’t work. After thoroughly looking at the way you expect the LEDs to be lit up they aren’t in a perfect order and @Christopher_Kirkman1 tail idea won’t work either since the tail isn’t always green, red, blue, black when you follow the order of how the LEDs would be wired. The only thing I can think of is setting up some dummy arrays (1 for each set of LEDs that will have the same colors) and mapping the leds to them.

The RGB Shades project could be a good place to start from to get an idea how mapping works since they are using mapping for the LEDs on the shades.

Better image. I just made

missing/deleted image from Google+

missing/deleted image from Google+

I was thinking command each row with an array that’s time offset from the next row. But I’m so terrible at this stuff

Also I’m not limited to wiring it this way