-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers/display/ssd1306.py upside_down static method added #5160
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
Conversation
The added `upside_down` static method causes the contents to be rendered with a 180° rotation. If a display is to be run upside down, this method must be called prior to instantiating a `Writer` for this display. This particular OLED command sequence was originally discussed [here](https://digistump.com/board/index.php?topic=1669.0). A similar static method [only works for the `Cwriter` class](https://github.com/peterhinch/micropython-font-to-py/blob/master/writer/WRITER.md#221-static-method).
drivers/display/ssd1306.py
If you have a boolean argument, rotation can be toggled.
|
Or if you want to be able to toggle either the segment or common ordering independently:
Which will give you: rotate 0 deg, mirror-x, mirror-y and rotate 180 deg. |
@mcauser I would then be in favour of adding separate |
Hi @stroobandt There's a whole bunch more functionality this display supports which is not exposed in this driver. Changing the com output direction updates immediately on the display, but remapping the segments only affects new data that is written to the display, adding to novice confusion. Perhaps it should be added to |
@mcauser Dear Mike, I entirely agree with you that setting this during the initialisation of the display is the safest thing to do. However, the I would rather propose adding a named
How do I proceed further? |
You could just add another commit, or update your existing commit with an |
Display rotation was implemented in PR #7135 |
Removed default UART, SPI and I2C from Tiny2040 config
As mentioned above, rotation was implemented in 9eea51b and it looks like that is more general than the patch here. So closing. |
The added
upside_down
static method causes the contents to be rendered with a 180° rotation.If a display is to be run upside down, this method must be called prior to instantiating a
Writer
for this display.This particular OLED command sequence was originally discussed here.
A similar static method only works for the
Cwriter
class.