File tree Expand file tree Collapse file tree
PyPortal_Smart_Thermometer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,10 @@ def play_wav(wav):
6161
6262AUDIO = audioio .AudioOut (board .SPEAKER ) # Speaker
6363
64- board .DISPLAY .auto_brightness = False
64+ try :
65+ board .DISPLAY .auto_brightness = False
66+ except AttributeError :
67+ pass
6568TOUCH1 = touchio .TouchIn (board .TOUCH1 ) # Capacitive touch pads
6669TOUCH2 = touchio .TouchIn (board .TOUCH2 )
6770TOUCH3 = touchio .TouchIn (board .TOUCH3 )
Original file line number Diff line number Diff line change @@ -48,7 +48,10 @@ def load_wav(name):
4848
4949AUDIO = audioio .AudioOut (board .SPEAKER ) # Speaker
5050
51- board .DISPLAY .auto_brightness = False
51+ try :
52+ board .DISPLAY .auto_brightness = False
53+ except AttributeError :
54+ pass
5255
5356# Set up accelerometer on I2C bus, 4G range:
5457I2C = board .I2C ()
Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ def set_backlight(val):
6363 off, and ``1`` is 100% brightness.
6464 """
6565 val = max (0 , min (1.0 , val ))
66- board .DISPLAY .auto_brightness = False
66+ try :
67+ board .DISPLAY .auto_brightness = False
68+ except AttributeError :
69+ pass
6770 board .DISPLAY .brightness = val
6871
6972
Original file line number Diff line number Diff line change @@ -76,7 +76,10 @@ def set_backlight(val):
7676 off, and ``1`` is 100% brightness.
7777 """
7878 val = max (0 , min (1.0 , val ))
79- board .DISPLAY .auto_brightness = False
79+ try :
80+ board .DISPLAY .auto_brightness = False
81+ except AttributeError :
82+ pass
8083 board .DISPLAY .brightness = val
8184
8285while True :
Original file line number Diff line number Diff line change 5151# Value between 0 and 1 where 0 is OFF, 0.5 is 50% and 1 is 100% brightness.
5252def set_backlight (val ):
5353 val = max (0 , min (1.0 , val ))
54- board .DISPLAY .auto_brightness = False
54+ try :
55+ board .DISPLAY .auto_brightness = False
56+ except AttributeError :
57+ pass
5558 board .DISPLAY .brightness = val
5659
5760
You can’t perform that action at this time.
0 commit comments