chandrawi / ADS1x15-ADC

Python library used for ADS1x15 analog to digital converter
MIT License
21 stars 6 forks source link

ADS1x15.ADS1115(0, i2c_address) throws error /dev/i2c-1 not found #4

Open ddequidt opened 1 year ago

ddequidt commented 1 year ago

Hello, Good work. Just reporting an issue seen on my old RPi B which use i2c bus0 /dev/i2c-0

ADS1x15.ADS1115(0, i2c_address) throws error /dev/i2c-1 not found Seems to be due to early initialisation of SMBus at https://github.com/chandrawi/ADS1x15-ADC/blob/d2f6e7f04a32b906a4f70a81d39b4d172f7e5c8e/ADS1x15/ADS1x15.py#L69

chandrawi commented 1 year ago

Yes, this should be an issue if the I2C / SMBus interface 1 is not activated, and user only want to using other SMBus. So I Think We should omit i2c initialisation in line 69. The I2C is also initialized in the constructor.

Have you test to omit code in line 69?

ddequidt commented 1 year ago

Yes it works by removing the line.