Merge pull request #1090 from dglaude/patch-1
rounding temperature as last operation
This commit is contained in:
commit
fc3d00471d
1 changed files with 3 additions and 3 deletions
|
|
@ -338,12 +338,12 @@ while True:
|
|||
light = light_sensor.value
|
||||
|
||||
if adt: # Only if we have the temperature sensor
|
||||
tempC = round(adt.temperature)
|
||||
tempC = adt.temperature
|
||||
else: # No temperature sensor
|
||||
tempC = round(microcontroller.cpu.temperature)
|
||||
tempC = microcontroller.cpu.temperature
|
||||
|
||||
tempF = tempC * 1.8 + 32
|
||||
sensor_data.text = 'Touch: {}\nLight: {}\n Temp: {}°F'.format(touch, light, tempF)
|
||||
sensor_data.text = 'Touch: {}\nLight: {}\n Temp: {:.0f}°F'.format(touch, light, tempF)
|
||||
|
||||
# ------------- Handle Button Press Detection ------------- #
|
||||
if touch: # Only do this if the screen is touched
|
||||
|
|
|
|||
Loading…
Reference in a new issue