File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
import time
2
2
import board
3
+ import microcontroller
3
4
import displayio
4
5
import busio
5
6
from analogio import AnalogIn
@@ -338,11 +339,11 @@ def switch_view(what_view):
338
339
339
340
if adt : # Only if we have the temperature sensor
340
341
tempC = round (adt .temperature )
341
- tempF = tempC * 1.8 + 32
342
- sensor_data . text = 'Touch: {} \n Light: {} \n Temp: {}°F' . format ( touch , light , tempF )
342
+ else : # No temperature sensor
343
+ tempC = round ( microcontroller . cpu . temperature )
343
344
344
- else : # No temperature sensor on Titano and Pynt
345
- sensor_data .text = 'Touch: {}\n Light: {}' .format (touch , light )
345
+ tempF = tempC * 1.8 + 32
346
+ sensor_data .text = 'Touch: {}\n Light: {}\n Temp: {}°F ' .format (touch , light , tempF )
346
347
347
348
# ------------- Handle Button Press Detection ------------- #
348
349
if touch : # Only do this if the screen is touched
You can’t perform that action at this time.
0 commit comments