-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setRotation does not work #26
Comments
To give credit where due, my code was taken from you here: |
i dont think we did rotation for this display because it doesnt have any 'smarts' about MADCTL? but you could try adding it manually in some way if you like! |
Thanks for confirming @ladyada. 3 thoughts
|
wanna try adding support? that would be the best! @makermelissa can also try taking a look later, i think this was one of our first displays so we didn't have rotation support yet |
So, I ended up fixing rotation one level higher, in my multi-API library that supports NeoMatrix, RGBPanels, and now SSD1331 offering GFX, FastLED, and LEDMatrix APIs:
Rotation is done between the virtual framebuffer and the SSD1331 when the frame is copied over:
Using my library has a few advantages despite the obvious loss of RAM (i.e. you'll want an ESP8266, ESP32, teensy, etc...):
|
Rotation on non-MADCTL displays is typically brute-forced at the drawPixel() level (see Adafruit_SSD1306 for an example) and would be an appropriate place to handle it here. |
It sounds like you got it working for your particular setup @marcmerlin. As @PaintYourDragon mentioned, it will probably need to be done using a brute-force method so that it will work the same as the other displays and play along nicely. It sounds like this feature is something you don't need added, so I will probably go ahead and add it, so I'm going to leave the issue open. |
Thanks @makermelissa for the reply. Sorry that I wasn't very clear on what the intent of my reply, was. @ladyada told me that she'd welcome a PR. I then went to work on my problem which was to extend my triple API support to more backends (GFX + the other 2) and in the process of doing so, realized that it was trivial for me to add rotation when copying from my framebuffer to your device driver. So, as a summary
But back to this bug, you can decide if it's indeed achievable or not given the writePixels problems and leave it open or close accordingly. |
I just switched to https://github.com/moononournation/Arduino_GFX and it seems that SSD1331 supports rotation. See https://github.com/moononournation/Arduino_GFX/blob/d3572d287e70395057e69f8c8be716e3ccec16c9/src/display/Arduino_SSD1331.cpp#L96 |
With Arduino, they are 4 possibilities for rotation: 0, 1, 2, 3 with the command display.setRotation(x)
You can refere to Adafruit rotating display example
|
display.setRotation(1) does nothing and after issuing it, fonts get displayed in the same direction than with display.setRotation(0);
Example code:
https://github.com/adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino/pull/24/files#diff-ef8b6e873f94e375375e7998b2b43ccdR483
yes, the code is a much longer demo but basically rotation just works with other backends this same demo was written on (actually the text scroll code is yours, from a bicolor 8x8 matrix I bought from you eons ago).
Seems that basically setRotation is not implemented at all
https://github.com/sumotoy/SSD_13XX claims to be a much faster fork that was originally started partially to fix the lack of rotation support.
The text was updated successfully, but these errors were encountered: