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 90f8cfe commit 5364778Copy full SHA for 5364778
examples/sgp30_test.py
@@ -8,9 +8,19 @@
8
# Create library object on our I2C port
9
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
10
11
+print("SGP30 serial #", [hex(i) for i in sgp30._serial])
12
+
13
sgp30.sgp_iaq_init()
14
+sgp30.sgp_set_iaq_baseline(0x8973, 0x8aae)
15
16
+elapsed_sec = 0
17
18
while True:
19
co2eq, tvoc = sgp30.sgp_iaq_measure()
20
print("CO2eq = %d ppm \t TVOC = %d ppb" % (co2eq, tvoc))
- time.sleep(5)
21
+ time.sleep(1)
22
+ elapsed_sec += 1
23
+ if elapsed_sec > 10:
24
+ elapsed_sec = 0
25
+ co2eq_base, tvoc_base = sgp30.sgp_get_iaq_baseline()
26
+ print("**** Baseline values: CO2eq = 0x%x, TVOC = 0x%x" % (co2eq_base, tvoc_base))
0 commit comments