We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d754f3 commit f1bf60aCopy full SHA for f1bf60a
examples/htu21d_displayio_simpletest.py
@@ -15,7 +15,7 @@
15
main_group = Group()
16
# Initialize I2C bus and sensor.
17
i2c = board.I2C() # uses board.SCL and board.SDA
18
-sensor = HTU21D(i2c)
+htu = HTU21D(i2c)
19
20
# Create Label(s) to show the readings. If you have a very small
21
# display you may need to change to scale=1.
@@ -37,6 +37,8 @@
37
# begin main loop
38
while True:
39
# update the text of the label(s) to show the sensor readings
40
- display_output_label.text = f"Temperature:{sensor.temperature:.1f}C\nHumidity:{sensor.relative_humidity:.1f}%\n"
+ display_output_label.text = (
41
+ f"Temp: {htu.temperature:.1f}C\n Hum: {htu.relative_humidity:.1f}%\n"
42
+ )
43
# wait for a bit
44
time.sleep(0.5)
0 commit comments