Skip to content

Commit aa6c6f2

Browse files
authored
Merge pull request #9 from Septolum/master
Add an Invert option
2 parents 393fa95 + 99184e2 commit aa6c6f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_st7735r.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@
8383
# pylint: disable=too-few-public-methods
8484
class ST7735R(displayio.Display):
8585
"""ST7735 driver for ST7735R"""
86-
def __init__(self, bus, *, bgr=False, **kwargs):
86+
def __init__(self, bus, *, bgr=False, invert=False, **kwargs):
8787
"""
8888
:param bool bgr: (Optional) An extra init sequence to append (default=False)
8989
"""
9090
init_sequence = _INIT_SEQUENCE
9191
if bgr:
9292
init_sequence += b"\x36\x01\xC0" # _MADCTL Default rotation plus BGR encoding
93+
if invert:
94+
init_sequence += b"\x21\x00" # _INVON
9395
super().__init__(bus, init_sequence, **kwargs)

0 commit comments

Comments
 (0)