File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 39
39
g = displayio .Group ()
40
40
41
41
# Display a ruler graphic from the root directory of the CIRCUITPY drive
42
- f = open ("/display-ruler.bmp" , "rb" )
42
+ with open ("/display-ruler.bmp" , "rb" ) as f :
43
+ pic = displayio .OnDiskBitmap (f )
44
+ # Create a Tilegrid with the bitmap and put in the displayio group
45
+ t = displayio .TileGrid (pic , pixel_shader = displayio .ColorConverter ())
46
+ g .append (t )
43
47
44
- pic = displayio .OnDiskBitmap (f )
45
- # Create a Tilegrid with the bitmap and put in the displayio group
46
- t = displayio .TileGrid (pic , pixel_shader = displayio .ColorConverter ())
47
- g .append (t )
48
+ # Place the display group on the screen (does not refresh)
49
+ display .show (g )
48
50
49
- # Place the display group on the screen (does not refresh)
50
- display .show ( g )
51
+ # Show the image on the display
52
+ display .refresh ( )
51
53
52
- # Show the image on the display
53
- display .refresh ()
54
+ print ("refreshed" )
54
55
55
- print ("refreshed" )
56
-
57
- # Do Not refresh the screen more often than every 180 seconds
58
- # for eInk displays! Rapid refreshes will damage the panel.
59
- time .sleep (180 )
56
+ # Do Not refresh the screen more often than every 180 seconds
57
+ # for eInk displays! Rapid refreshes will damage the panel.
58
+ time .sleep (180 )
You can’t perform that action at this time.
0 commit comments