Skip to content

Add an Invert option #9

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 2 commits into from
Aug 2, 2019
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
4 changes: 3 additions & 1 deletion adafruit_st7735r.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@
# pylint: disable=too-few-public-methods
class ST7735R(displayio.Display):
"""ST7735 driver for ST7735R"""
def __init__(self, bus, *, bgr=False, **kwargs):
def __init__(self, bus, *, bgr=False, invert=False, **kwargs):
"""
:param bool bgr: (Optional) An extra init sequence to append (default=False)
"""
init_sequence = _INIT_SEQUENCE
if bgr:
init_sequence += b"\x36\x01\xC0" # _MADCTL Default rotation plus BGR encoding
if invert:
init_sequence += b"\x21\x00" # _INVON
super().__init__(bus, init_sequence, **kwargs)