File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change 13
13
display_group = displayio .Group ()
14
14
15
15
# Display a ruler graphic from the root directory of the CIRCUITPY drive
16
- file = open ("/display-ruler.bmp" , "rb" )
16
+ with open ("/display-ruler.bmp" , "rb" ) as file :
17
+ picture = displayio .OnDiskBitmap (file )
18
+ # Create a Tilegrid with the bitmap and put in the displayio group
19
+ sprite = displayio .TileGrid (picture , pixel_shader = displayio .ColorConverter ())
20
+ display_group .append (sprite )
17
21
18
- picture = displayio .OnDiskBitmap (file )
19
- # Create a Tilegrid with the bitmap and put in the displayio group
20
- sprite = displayio .TileGrid (picture , pixel_shader = displayio .ColorConverter ())
21
- display_group .append (sprite )
22
+ # Place the display group on the screen
23
+ display .show (display_group )
22
24
23
- # Place the display group on the screen
24
- display .show (display_group )
25
+ # Refresh the display to have it actually show the image
26
+ # NOTE: Do not refresh eInk displays sooner than 180 seconds
27
+ display .refresh ()
28
+ print ("refreshed" )
25
29
26
- # Refresh the display to have it actually show the image
27
- # NOTE: Do not refresh eInk displays sooner than 180 seconds
28
- display .refresh ()
29
- print ("refreshed" )
30
-
31
- time .sleep (180 )
30
+ time .sleep (180 )
You can’t perform that action at this time.
0 commit comments