Skip to content

Cannot read data from SGP40 sensor #9193

Discussion options

You must be logged in to vote

Your program doesn't ever get a chance to print anything

while True:
    value = sgp40.measure_raw()
    time.sleep(1)

print(value)

The print() is not inside the loop, and because the loop never terminates, the print() will never execute.

I suspect you want to write instead:

while True:
    value = sgp40.measure_raw()
    print(value)
    time.sleep(1)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adysanro
Comment options

Answer selected by adysanro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants