Cannot read data from SGP40 sensor #9193
-
Hi, Issue: cannot read sensor data. I am not getting a message or error message. The output section remains empty. I ran an i2c.scan(). The device is detected from GP pins 12 and 13 at address 0x59 (which is the address mentioned in the datasheet for SGP40). I am using the same detected GP pins 12 and 13 in my sample Python code. What am I missing? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Your program doesn't ever get a chance to print anything while True:
value = sgp40.measure_raw()
time.sleep(1)
print(value) The I suspect you want to write instead: while True:
value = sgp40.measure_raw()
print(value)
time.sleep(1) |
Beta Was this translation helpful? Give feedback.
Your program doesn't ever get a chance to print anything
The
print()
is not inside the loop, and because the loop never terminates, theprint()
will never execute.I suspect you want to write instead: