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

Fixed i2c port #10

Open
danielfett opened this issue Mar 15, 2022 · 1 comment
Open

Fixed i2c port #10

danielfett opened this issue Mar 15, 2022 · 1 comment

Comments

@danielfett
Copy link

It was surprising to see that the I2C port/bus cannot be defined during run time. Usually, python interfaces for i2c devices accept both an i2c address and a port/bus number.

@mcalisterkm
Copy link

To change the i2C port and address requires the current instance to be closed and a new one opened
This is an example open
bme = BME68X(cnst.BME68X_I2C_ADDR_LOW, 0)

And this will close it
bme.close_i2c()

Re-starting the i2c will loose state and there will be a new stabilisation period, but hopefully a short one.

I am not sure what your use case is, but I have run two BME688 sensors on the same I2C bus (different addresses) collecting data using one python script. I also run I2C Bus 3 with a pm25 sensor which runs at 100khz , and the standard I2C Bus with faster sensors such as the BME 688.

Keith

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

2 participants