Skip to content

Remove usage of the set_vertical_scroll Display constructor parameter. #5

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

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions adafruit_displayio_sh1106.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
class SH1106(displayio.Display):
"""
SH1106 driver for use with DisplayIO

:param bus: The bus that the display is connected to.
:param int width: The width of the display. Maximum of 132
:param int height: The height of the display. Maximum of 64
Expand All @@ -71,7 +72,6 @@ def __init__(self, bus, **kwargs):
grayscale=True,
pixels_in_byte_share_row=False, # in vertical (column) mode
data_as_commands=True, # every byte will have a command byte preceeding
set_vertical_scroll=0xD3, # TBD -- not sure about this one!
brightness_command=0x81,
single_byte_bounds=True,
# for sh1107 use column and page addressing.
Expand All @@ -86,19 +86,21 @@ def __init__(self, bus, **kwargs):
def is_awake(self):
"""
The power state of the display. (read-only)
True if the display is active, False if in sleep mode.

`True` if the display is active, `False` if in sleep mode.
"""
return self._is_awake

def sleep(self):
"""
Put display into sleep mode
The display uses < 5uA in sleep mode
Put display into sleep mode. The display uses < 5uA in sleep mode.

Sleep mode does the following:
1) Stops the oscillator and DC-DC circuits
2) Stops the OLED drive
3) Remembers display data and operation mode active prior to sleeping
4) The MP can access (update) the built-in display RAM

1) Stops the oscillator and DC-DC circuits
2) Stops the OLED drive
3) Remembers display data and operation mode active prior to sleeping
4) The MP can access (update) the built-in display RAM
"""
if self._is_awake:
self.bus.send(int(0xAE), "") # 0xAE = display off, sleep mode
Expand Down