Skip to content

Commit 221a935

Browse files
committed
Fixed lint issues, added rotation for ili9341
1 parent 8bd7903 commit 221a935

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

adafruit_rgb_display/rgb.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ class Display: #pylint: disable-msg=no-member
120120
def __init__(self, width, height, rotation):
121121
self.width = width
122122
self.height = height
123-
self.rotation = rotation
123+
if rotation not in (0, 90, 180, 270):
124+
raise ValueError('Rotation must be 0/90/180/270')
125+
self._rotation = rotation
124126
self.init()
125127

126128
def init(self):

adafruit_rgb_display/ssd1351.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ class SSD1351(DisplaySPI):
115115

116116
#pylint: disable-msg=useless-super-delegation, too-many-arguments
117117
def __init__(self, spi, dc, cs, rst=None, width=128, height=128,
118-
rotation=rotation):
118+
rotation=0):
119119
super().__init__(spi, dc, cs, rst, width, height, rotation)

examples/rgb_display_pillow_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789
2525
#disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789
2626
#disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357
27-
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
27+
disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341
2828
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
2929

3030
# Create blank image for drawing.

examples/rgb_display_pillow_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789
2121
#disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789
2222
#disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357
23-
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
23+
disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341
2424
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
2525

2626
# Create blank image for drawing.

examples/rgb_display_pillow_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#disp = st7789.ST7789(spi, rotation=90 # 2.0" ST7789
2323
#disp = st7789.ST7789(spi, height=240, y_offset=80, rotation=90 # 1.3", 1.54" ST7789
2424
#disp = hx8357.HX8357(spi, rotation=180, # 3.5" HX8357
25-
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
25+
disp = ili9341.ILI9341(spi, rotation=90, # 2.2", 2.4", 2.8", 3.2" ILI9341
2626
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
2727

2828
# Create blank image for drawing.

0 commit comments

Comments
 (0)