File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 3
3
#
4
4
# SPDX-License-Identifier: MIT
5
5
import time
6
- import board
7
6
import json
8
- import adafruit_dps310
9
- import adafruit_ahtx0
10
7
from adafruit_display_shapes .circle import Circle
11
8
from adafruit_funhouse import FunHouse
12
9
25
22
print ("WiFi secrets are kept in secrets.py, please add them there!" )
26
23
raise
27
24
28
- # Connect to the Sensors
29
- i2c = board .I2C ()
30
- dps310 = adafruit_dps310 .DPS310 (i2c )
31
- aht20 = adafruit_ahtx0 .AHTx0 (i2c )
32
-
33
25
funhouse = FunHouse (default_bg = 0x0F0F00 )
34
26
funhouse .peripherals .dotstars .fill (INITIAL_LIGHT_COLOR )
35
27
79
71
def update_enviro ():
80
72
global environment
81
73
82
- temp = aht20 .temperature
74
+ temp = funhouse . peripherals .temperature
83
75
unit = "C"
84
76
if USE_FAHRENHEIT :
85
77
temp = temp * (9 / 5 ) + 32
86
78
unit = "F"
87
79
88
80
environment ["temperature" ] = temp
89
- environment ["pressure" ] = dps310 .pressure
90
- environment ["humidity" ] = aht20 .relative_humidity
81
+ environment ["pressure" ] = funhouse . peripherals .pressure
82
+ environment ["humidity" ] = funhouse . peripherals .relative_humidity
91
83
environment ["light" ] = funhouse .peripherals .light
92
84
93
85
funhouse .set_text ("{:.1f}{}" .format (environment ["temperature" ], unit ), temp_label )
You can’t perform that action at this time.
0 commit comments