Skip to content

Commit c11e215

Browse files
committed
fix some bug
1 parent d96c058 commit c11e215

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

web_interface/get_data.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,21 @@ def readSensor(self):
6060
return (temp, humi)
6161

6262

63-
am232x = AM232x(1)
64-
(t, h) = am232x.readSensor()
65-
print("Temperature: %.2f C" % (t))
66-
print("Humidity: %.2f" % (h))
63+
def get_data():
64+
am232x = AM232x(1)
65+
(t, h) = am232x.readSensor()
66+
print("Temperature: %.2f C" % (t))
67+
print("Humidity: %.2f" % (h))
68+
return (t, h)
6769

6870

6971
def get_temperature():
72+
(t, h) = get_data()
7073
return float(t)
7174

7275

7376
def get_humidity():
77+
(t, h) = get_data()
7478
return float(h)
7579

7680

0 commit comments

Comments
 (0)