Skip to content

Commit 521dcf7

Browse files
committed
Add getting data rate label to example
1 parent c5eb147 commit 521dcf7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/hts221_simpletest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
i2c = board.I2C()
99
hts = adafruit_hts221.HTS221(i2c)
1010

11+
data_rate = adafruit_hts221.Rate.label[hts.data_rate]
12+
print("Using data rate of: {:.1f} Hz".format(data_rate))
13+
print("")
14+
1115
while True:
12-
print("Relative Humidity: %.2f %% rH" % hts.relative_humidity)
13-
print("Temperature: %.2f C" % hts.temperature)
16+
print("Relative Humidity: {:.2f} % rH".format(hts.relative_humidity))
17+
print("Temperature: {:.2f} C".format(hts.temperature))
1418
print("")
1519
time.sleep(1)

0 commit comments

Comments
 (0)