3535IMAGE_SPRITE_X = (display .width // 3 ) - 10
3636IMAGE_SPRITE_Y = display .height // 5
3737
38- # Create a displayIO Group
38+ # Create a displayIO Group
3939group = displayio .Group ()
4040
4141# Draw the background
6666# Show the group
6767display .root_group = group
6868
69- def set_image (group , filename ):
69+ def set_image (image_group , filename ):
7070 """Sets the image file for a given group for display."""
7171 print (f"Set image to { filename } " )
72- if group :
73- group .pop ()
72+ if image_group :
73+ image_group .pop ()
7474
7575 image_file = open (filename , "rb" )
7676 image = displayio .OnDiskBitmap (image_file )
7777 image_sprite = displayio .TileGrid (image ,
7878 pixel_shader = getattr (image , 'pixel_shader' , displayio .ColorConverter ()))
7979 image_sprite .x = IMAGE_SPRITE_X
8080 image_sprite .y = IMAGE_SPRITE_Y
81- group .append (image_sprite )
81+ image_group .append (image_sprite )
8282
8383prv_location = None
8484while True :
@@ -105,7 +105,7 @@ def set_image(group, filename):
105105 else :
106106 print ("Location not found in images!" )
107107 # Update the location text
108- text_area_location .text = f "Error: Unknown Value!"
108+ text_area_location .text = "Error: Unknown Value!"
109109 # Show the refreshed group
110110 display .root_group = group
111111 except RuntimeError as e :
0 commit comments