I bought a cheap RGB123 clone (16x16 WS28xx rgb matrix) and the neopixel lib works with it. My problem is using Graphics lib the display is flipped on this module. I seem to need to mirror the buffer horizontally. I know that Graphics has setRotation to apply rotation before writing to the buffer, is there similar thing for mirroring? Another way could be to clone the buffer and apply matrix transform (is the arrayBuffer a 2D array?) to mirror it and then write the transformed buffer to the LEDs. Thought I'd ask here before researching the buffer transform route...
Yes, it should be pretty straightforward. You spotted setRotation, but it's actually got an optional second argument to mirror as well: http://www.espruino.com/Reference#l_Graphics_setRotation
So you can either do setRotation(0,true) to flip one way, or can rotate 180 degrees and mirror with setRotation(2,true) to flip the other :)
Got it thanks!
Oh great this exactly what i'm looking for.
Want to display text on display reflected in water...
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem