@@ -41,12 +41,15 @@ class Graphics:
41
41
Defaults to 0x000000.
42
42
:param bool auto_refresh: Automatically refresh the eInk after writing to displayio.
43
43
Defaults to True.
44
+ :param rotation: Default rotation is landscape (270) but can be 0, 90, 180 for portrait/rotated
44
45
:param debug: Turn on debug print outs. Defaults to False.
45
46
46
47
"""
47
48
48
49
# pylint: disable=too-many-instance-attributes, too-many-locals, too-many-branches, too-many-statements
49
- def __init__ (self , * , default_bg = 0xFFFFFF , auto_refresh = True , debug = False ):
50
+ def __init__ (
51
+ self , * , default_bg = 0xFFFFFF , auto_refresh = True , rotation = 270 , debug = False
52
+ ):
50
53
51
54
self ._debug = debug
52
55
if not hasattr (board , "DISPLAY" ):
@@ -65,7 +68,7 @@ def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
65
68
display_bus ,
66
69
width = 296 ,
67
70
height = 128 ,
68
- rotation = 270 ,
71
+ rotation = rotation ,
69
72
black_bits_inverted = False ,
70
73
color_bits_inverted = False ,
71
74
grayscale = True ,
@@ -74,6 +77,7 @@ def __init__(self, *, default_bg=0xFFFFFF, auto_refresh=True, debug=False):
74
77
)
75
78
else :
76
79
self .display = board .DISPLAY
80
+ self .display .rotation = rotation
77
81
78
82
self .auto_refresh = auto_refresh
79
83
0 commit comments