Skip to content

Commit

Permalink
Merge pull request #23 from lesamouraipourpre/vertical-scroll
Browse files Browse the repository at this point in the history
Remove usage of the set_vertical_scroll Display constructor parameter.
  • Loading branch information
tannewt committed Aug 24, 2021
2 parents 4b32558 + 4c55765 commit 08ac087
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions adafruit_displayio_ssd1306.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@


class SSD1306(displayio.Display):
"""SSD1306 driver"""
"""
SSD1306 driver
:param int width: The width of the display
:param int height: The height of the display
:param int rotation: The rotation of the display in degrees. Default is 0. Must be one of
(0, 90, 180, 270)
"""

def __init__(self, bus, **kwargs):
# Patch the init sequence for 32 pixel high displays.
Expand All @@ -74,7 +81,6 @@ def __init__(self, bus, **kwargs):
set_column_command=0x21,
set_row_command=0x22,
data_as_commands=True,
set_vertical_scroll=0xD3,
brightness_command=0x81,
single_byte_bounds=True,
)
Expand All @@ -85,17 +91,18 @@ 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.
:type: bool
"""
return self._is_awake

def sleep(self):
"""
Put display into sleep mode
Put display into sleep mode.
Display uses < 10uA in sleep mode
Display remembers display data and operation mode active prior to sleeping
MP can access (update) the built-in display RAM
Display uses < 10uA in sleep mode. Display remembers display data and operation mode
active prior to sleeping. 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

0 comments on commit 08ac087

Please sign in to comment.