Skip to content

Commit 1d34cd3

Browse files
committed
Added 240x240 support, reorganized initializers
1 parent 84cf3f2 commit 1d34cd3

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

examples/rgb_display_pillow_demo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
# Setup SPI bus using hardware SPI:
2020
spi = board.SPI()
2121

22-
# Create the ILI9341 display:
23-
disp = ili9341.ILI9341(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ILI9341
24-
#disp = st7789.ST7789(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ST7789
22+
# Create the display:
23+
#disp = st7789.ST7789(spi, # 2.0" ST7789
24+
#disp = st7789.ST7789(spi, width=240, height=240, y_offset=80, # 1.3", 1.54" ST7789
25+
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
26+
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
27+
2528

2629
# Create blank image for drawing.
2730
# Make sure to create image with mode 'RGB' for full color.

examples/rgb_display_pillow_image.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
# Setup SPI bus using hardware SPI:
1616
spi = board.SPI()
1717

18-
# Create the ILI9341 display:
19-
disp = ili9341.ILI9341(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ILI9341
20-
#disp = st7789.ST7789(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ST7789
18+
# Create the display:
19+
#disp = st7789.ST7789(spi, # 2.0" ST7789
20+
#disp = st7789.ST7789(spi, width=240, height=240, y_offset=80, # 1.3", 1.54" ST7789
21+
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
22+
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
2123

2224
# Create blank image for drawing.
2325
# Make sure to create image with mode 'RGB' for full color.

examples/rgb_display_pillow_stats.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
# Setup SPI bus using hardware SPI:
1818
spi = board.SPI()
1919

20-
# Create the ILI9341 display:
21-
disp = ili9341.ILI9341(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ILI9341
22-
#disp = st7789.ST7789(spi, cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE) #ST7789
20+
# Create the display:
21+
#disp = st7789.ST7789(spi, # 2.0" ST7789
22+
#disp = st7789.ST7789(spi, width=240, height=240, y_offset=80, # 1.3", 1.54" ST7789
23+
disp = ili9341.ILI9341(spi, # 2.2", 2.4", 2.8", 3.2" ILI9341
24+
cs=cs_pin, dc=dc_pin, rst=reset_pin, baudrate=BAUDRATE)
2325

2426
# Create blank image for drawing.
2527
# Make sure to create image with mode 'RGB' for full color.

0 commit comments

Comments
 (0)