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 1313display_group = displayio .Group ()
1414
1515# 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 )
1721
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 )
2224
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" )
2529
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