Skip to content

Commit ee73323

Browse files
authored
Merge pull request #8 from makermelissa/master
Added example with pinout specific to the shield
2 parents eb38abe + 56e9232 commit ee73323

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
*.mpy
2+
.idea
13
__pycache__
24
_build
35
*.pyc
46
.env
57
build*
68
bundles
9+
*.DS_Store
10+
.eggs
11+
dist
12+
**/*.egg-info

examples/ili9341_shield_simpletest.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
This test will initialize the display using displayio
3+
and draw a solid red background. Pinouts are for the 2.8"
4+
TFT Shield
5+
"""
6+
7+
import board
8+
import displayio
9+
import adafruit_ili9341
10+
11+
spi = board.SPI()
12+
tft_cs = board.D10
13+
tft_dc = board.D9
14+
15+
displayio.release_displays()
16+
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
17+
18+
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
19+
20+
# Make the display context
21+
splash = displayio.Group(max_size=10)
22+
display.show(splash)
23+
24+
color_bitmap = displayio.Bitmap(320, 240, 1)
25+
color_palette = displayio.Palette(1)
26+
color_palette[0] = 0xFF0000
27+
28+
bg_sprite = displayio.TileGrid(color_bitmap,
29+
pixel_shader=color_palette,
30+
x=0, y=0)
31+
splash.append(bg_sprite)
32+
33+
while True:
34+
pass

examples/ili9341_simpletest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
This test will initialize the display using displayio
3-
and draw a solid red background
3+
and draw a solid red background. The default pinouts are
4+
for the 2.4" TFT FeatherWing with a Feather M4 or M0.
45
"""
56

67
import board

0 commit comments

Comments
 (0)