8000 Feature request: display sleep/wake functions · Issue #24 · adafruit/Adafruit_CircuitPython_MacroPad · GitHub
[go: up one dir, main page]

Skip to content

Feature request: display sleep/wake functions #24

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

Closed
rpavlik opened this issue Aug 13, 2021 · 2 comments · Fixed by #44
Closed

Feature request: display sleep/wake functions #24

rpavlik opened this issue Aug 13, 2021 · 2 comments · Fixed by #44

Comments

@rpavlik
Copy link
rpavlik commented Aug 13, 2021

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.

@tannewt
Copy link
Member
tannewt commented Aug 13, 2021

I think it'd be fine if this library used send to implement this. I'm not sure we need it in the core.

@rpavlik
Copy link
Author
rpavlik commented Aug 13, 2021

That makes sense. I wasn't sure how best to implement it, which is why I filed an issue linking to my bodge, instead of submitting a pull request :)

kalehmann added a commit to kalehmann/Adafruit_CircuitPython_MacroPad that referenced this issue May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0