Skip to content

Commit f1bf60a

Browse files
author
jposada202020
committed
long_line
1 parent 0d754f3 commit f1bf60a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/htu21d_displayio_simpletest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
main_group = Group()
1616
# Initialize I2C bus and sensor.
1717
i2c = board.I2C() # uses board.SCL and board.SDA
18-
sensor = HTU21D(i2c)
18+
htu = HTU21D(i2c)
1919

2020
# Create Label(s) to show the readings. If you have a very small
2121
# display you may need to change to scale=1.
@@ -37,6 +37,8 @@
3737
# begin main loop
3838
while True:
3939
# 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"
40+
display_output_label.text = (
41+
f"Temp: {htu.temperature:.1f}C\n Hum: {htu.relative_humidity:.1f}%\n"
42+
)
4143
# wait for a bit
4244
time.sleep(0.5)

0 commit comments

Comments
 (0)