Skip to content

Commit 2cd7054

Browse files
author
Melissa LeBlanc-Williams
committed
Added example for Mini TFT breakout
1 parent 7107fdb commit 2cd7054

File tree

2 files changed

+44
-8
lines changed

2 files changed

+44
-8
lines changed

examples/st7735_miniTFT_simpletest.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
"""
2-
This example will test out the display on the Mini TFT FeatherWing
2+
This example will test out the display on the Mini TFT Breakout
33
"""
44
import board
55
import displayio
6-
from adafruit_seesaw.seesaw import Seesaw
76
from adafruit_st7735.st7735r import ST7735R
87

9-
reset_pin = 8
10-
i2c = board.I2C()
11-
ss = Seesaw(i2c, 0x5E)
12-
ss.pin_mode(reset_pin, ss.OUTPUT)
13-
148
spi = board.SPI()
159
tft_cs = board.D5
1610
tft_dc = board.D6
1711

1812
displayio.release_displays()
1913
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
2014

21-
ss.digital_write(reset_pin, True)
2215
display = ST7735R(display_bus, width=160, height=80, rowstart=24, init=b"\x36\x01\x60")
2316

2417
# Make the display context
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""
2+
This example will test out the display on the Mini TFT FeatherWing
3+
"""
4+
import board
5+
import displayio
6+
from adafruit_seesaw.seesaw import Seesaw
7+
from adafruit_st7735.st7735r import ST7735R
8+
9+
reset_pin = 8
10+
i2c = board.I2C()
11+
ss = Seesaw(i2c, 0x5E)
12+
ss.pin_mode(reset_pin, ss.OUTPUT)
13+
14+
spi = board.SPI()
15+
tft_cs = board.D5
16+
tft_dc = board.D6
17+
18+
displayio.release_displays()
19+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
20+
21+
ss.digital_write(reset_pin, True)
22+
display = ST7735R(display_bus, width=160, height=80, rowstart=24, init=b"\x36\x01\x60")
23+
24+
# Make the display context
25+
splash = displayio.Group(max_size=10)
26+
display.show(splash)
27+
28+
color_bitmap = displayio.Bitmap(160, 80, 1)
29+
color_palette = displayio.Palette(1)
30+
color_palette[0] = 0xFF0000
31+
32+
try:
33+
bg_sprite = displayio.TileGrid(color_bitmap,
34+
pixel_shader=color_palette,
35+
position=(0, 0))
36+
except TypeError:
37+
bg_sprite = displayio.TileGrid(color_bitmap,
38+
pixel_shader=color_palette,
39+
x=0, y=0)
40+
splash.append(bg_sprite)
41+
42+
while True:
43+
pass

0 commit comments

Comments
 (0)