File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ This test will initialize the display using displayio
3
+ and draw a solid red background
4
+ """
5
+
6
+ import board
7
+ import displayio
8
+ import adafruit_ili9341
9
+
10
+ spi = board .SPI ()
11
+ tft_cs = board .D9
12
+ tft_dc = board .D10
13
+
14
+ displayio .release_displays ()
15
+ display_bus = displayio .FourWire (spi , command = tft_dc , chip_select = tft_cs )
16
+
17
+ display = adafruit_ili9341 .ILI9341 (display_bus )
18
+
19
+ # Make the display context
20
+ splash = displayio .Group (max_size = 10 )
21
+ display .show (splash )
22
+
23
+ color_bitmap = displayio .Bitmap (320 , 240 , 1 )
24
+ color_palette = displayio .Palette (1 )
25
+ color_palette [0 ] = 0xFF0000
26
+
27
+ try :
28
+ bg_sprite = displayio .TileGrid (color_bitmap ,
29
+ pixel_shader = color_palette ,
30
+ position = (0 , 0 ))
31
+ except TypeError :
32
+ bg_sprite = displayio .TileGrid (color_bitmap ,
33
+ pixel_shader = color_palette ,
34
+ x = 0 , y = 0 )
35
+ splash .append (bg_sprite )
36
+
37
+ while True :
38
+ pass
You can’t perform that action at this time.
0 commit comments