WS2812B (neopixel) and Graphics lib: custom matrix configuration #965
Replies: 13 comments
-
Posted at 2018-01-15 by n00b So I did a manual remapping from the Graphics.buffer to the way my modules are chained:
And use this code, with a util function to copy the triplets of RGB per index:
The above does the trick, but all of the array operations slowed down the performance quite a bit... :( Anybody know any tips on the best way for this kinds of operation? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by @MaBecker Well, there is a solution in Espruino to handle multiple NxN+NxN plates
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by n00b Thanks MaBe for the comment. I modified the H count:
but doesn't work for my 3 plates horizontal with this led array sequence:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by @MaBecker Check for option zigzag in createArrayBuffer() |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by n00b I see - I think that could work, but I'd have to reassemble my module differently:
However, being rotated, I don't think doing
will draw expectedly something like
but instead will create a rotated version of
Would work for fillRect or lines I think, but I need to draw text... Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by @gfwilliams Yes, you'd have to reassemble your module, but the That'd definitely be the fastest/easiest. If you're totally set on remapping using your method, I'd suggest using the Graphics lib, but to remap the flat image to the 3 panels.
Not tested, but something like that should work fine. It's a bit fiddly, but would be way nicer/more efficient if you were working with much bigger panels. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by n00b That does it! Thanks @gordon! You're the best :)! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-15 by @MaBecker like to share scrollString.js, a sample code to draw and scroll strings on a 3 x 8 by 8 panel attached is the wiring and a scrolling sample movie Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-16 by @gfwilliams @mabe neat! So in that case you're doing like you suggested above - placing them at 90 degrees to @n00b and using I'd say if someone didn't already have panels set up, that's the easier way to do it :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-17 by @MaBecker Using a remap function and a panelList allows you even a combination of panels like this: each p is a 8x8 panel like above
@gordon is it possible to inject a remap function into Graphic lib?Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-18 by @gfwilliams
Not really - the act of calling JS for every pixel write would really slow things down. For example you can't just remap the coordinates of a rectangle, because it could bridge two panels. It's better to do what I did in the example above and just use Graphics itself to remap to each separate panel. It'll be much faster too. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-25 by @MaBecker To be honest, I was thinking about adding it to GRAPHICS as option and call it like this:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-26 by @gfwilliams Why not just make a module to handle it, rather than building it into Espruino? It sounds like that kind of thing could easily be done with Graphics and drawImage as I'd mentioned above... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-01-14 by n00b
I got a several 4x4 neopixel-compatible modules:
and would like to string several of them horizontally to create a 16x4 matrix. Can the Graphics library work with this configuration?
I know in the RGB123 example you can create an array buffer x*y but wondering if it will work with arbitrary rows and columns since in regard to the wirings of arbitrary modules.
Thanks!
*edit: I need to do 12X4 instead of 16X4
Beta Was this translation helpful? Give feedback.
All reactions