2929# Turn on the basic GGA and RMC info (what you typically want)
3030gps .send_command (b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0' )
3131
32- # Set update rate to once a second (1hz ) which is what you typically want.
32+ # Set update rate to once a second (1Hz ) which is what you typically want.
3333gps .send_command (b'PMTK220,1000' )
3434
3535switch_io = DigitalInOut (board .SENSE )
3838
3939switch = Debouncer (switch_io )
4040
41- audio = audioio .AudioOut (board .A0 )
41+ audio = audioio .AudioOut (board .SPEAKER )
4242
4343backlight = DigitalInOut (board .TFT_BACKLIGHT )
4444backlight .direction = Direction .OUTPUT
@@ -60,19 +60,27 @@ def play_wave(filename):
6060 pass
6161
6262def show_image (filename ):
63- image_file = None
63+ # CircuitPython 6 & 7 compatible
6464 try :
6565 image_file = open (filename , "rb" )
6666 except OSError :
6767 image_file = open ("missing.bmp" , "rb" )
6868 odb = displayio .OnDiskBitmap (image_file )
69- face = displayio .Sprite (odb , pixel_shader = displayio .ColorConverter (), position = (0 , 0 ))
69+ face = displayio .TileGrid (
70+ odb ,
71+ pixel_shader = getattr (odb , 'pixel_shader' , displayio .ColorConverter ())
72+ )
73+
74+ # # CircuitPython 7+ compatible
75+ # try:
76+ # odb = displayio.OnDiskBitmap(filename)
77+ # except (OSError, ValueError):
78+ # odb = displayio.OnDiskBitmap("missing.bmp")
79+ # face = displayio.TileGrid(odb, pixel_shader=odb.pixel_shader)
80+
7081 backlight .value = False
7182 splash .append (face )
72- try :
73- board .DISPLAY .refresh (target_frames_per_second = 60 )
74- except AttributeError :
75- board .DISPLAY .wait_for_frame ()
83+ board .DISPLAY .refresh (target_frames_per_second = 60 )
7684 backlight .value = True
7785
7886
0 commit comments