Hello! For a school project, me and another student are working on a LED-matrix (12x12), made of WS2812b addressable leds. Somehow we are not getting the program to work properly. When we try to move the snake vertically it's all fine, but when the snake has to go horizontally, the leds will jump to various "lanes".
chrisdijkstra:
Our hardware is correct, when we load a code to run animations it runs perfectly.
It would still be useful if you showed how it was connected. e.g. is the sketch coded in a way that matches the way you've arranged the pixels into a matrix?
GypsumFantastic:
It would still be useful if you showed how it was connected. e.g. is the sketch coded in a way that matches the way you've arranged the pixels into a matrix?
I made this simple fritzing diagram, hope it helps!
Snake-Game-Library-for-ArduinoHey guys, it's not just the obvious that the final led on the row (say the most right one) should be connected to the first of the next (The most left one) rather then having the ledstrip snake over the matrix L->R then R-L then L->R ?? the Library seems to assume that the rows are all L->R
What I'm trying to get at is this. I think you might have your pixels wired in boustrophedon type arrangement (as below). But the setpixel function is coded for a straightforward raster type arrangement.
Hey guys, I have added a picture of our wiring as it is now, can you please tell us how we should wire it? (With a sketch of something?) Thankyou in advance!
I think it might be easier to adapt the setpixel() function, but if you wanted to re-wire then you need to have them something like the rough sketch below.
I'm not even out of bed and I already learned my word for the day
boustrophedon
Looking forward to using it.
BTW if you are stuck with a fixed panel that has boustrophedon wiring or worse (!), real programmers eschew mucking with the hardware and implement a correction layer with a map that un-snakes the addressing.
It has to be aprt of the tookit if you do much down on the ground here.
You can see the first row goes in order, the next four are flipped and so forth.
Then find things like
strip.setPixelColor(X, 0xcc00cc);
and change them to "look up" the right physical pixel, vis:
strip.setPixelColor(map[X], 0xcc00cc);
Maps like this can also be used to rotate or flip the display whilst allowing us to refer to one upright rationally numbered abstract. Extension to larger arrays or stranger arrangements should be straight ahead.