Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'int' object isn't iterable Micropython 1.19.1 #4

Open
Ajb2k3 opened this issue Feb 3, 2023 · 2 comments
Open

TypeError: 'int' object isn't iterable Micropython 1.19.1 #4

Ajb2k3 opened this issue Feb 3, 2023 · 2 comments

Comments

@Ajb2k3
Copy link

Ajb2k3 commented Feb 3, 2023

temperature, humidity = sensor.measure()
Traceback (most recent call last):
File "", line 1, in
File "sht30.py", line 136, in measure
File "sht30.py", line 100, in send_cmd
TypeError: 'int' object isn't iterable

@ravenium
Copy link

ravenium commented Apr 23, 2023

EDIT: If you're getting this, it means your SHT30 likely isn't connected properly. Try running this:

from machine import I2C, Pin

i2c = I2C(scl=Pin(5),sda=Pin(4))

i2c.scan()

If you get an empty set [], it means it couldn't find your SHT30.

@elschopi
Copy link

Grave digger here(seeing how long ago the last comment is)! Just began messing around with those SHT30 sensors, trying to expand my indoor sensor suite. I'm currently running Micropython 1.17 on an ESP32 dev board (the project is a bit older). Currently I'm using a BME280, an DS18B20 and a Pt100 (via ADS1115). I use a SPI TFT Display to visualize data, and send all data to a local influxdb via MQTT and NodeRED.
I've now added the SHT30 sensor on my I2C bus. When I try it out "stand-alone" in it's own little module, it works fine. However when I integrate it into my code, I get the "'int' object isn't iterable" error.
I can read the sensor once and get data back, but as soon as my loop comes back to it after about 30 secons sleep time, I get that error.
So I'm pretty sure it's connected properly, because in a separate .py it works.
What could cause that behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants