-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I was trying to sleep/wake the device (to save the shiny parts) when not in use. My usual technique (on TFTs anyway) is to set display.brightness = 0 to turn off the backlight, but I discovered that the command told by the source (in circuitpython core) for this board for brightness is actually "contrast" according to the controller datasheet (oled -> no backlight), which explains why it got dimmer but did not turn off completely.
The standalone SH1107 driver has sleep() and wake() functions that use explicit sleep/wake commands: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/blob/main/adafruit_displayio_sh1107.py#L164 but this board's display support is built-in using C, and no such functions are there. I ended up just mangling a copy of that library to wrap an existing displayio display, which works, but is not awesome. (see https://gist.github.com/rpavlik/73d1de102038f85de051fc1b8cdd3009 )
Not sure if "sleep" and "wake" can be monkey-patched in from Python into the C displayio class, or if there's some other, better way to provide those functions, but I figured this would be the library to do them in.