0

I am developing a program for a client using the Adafruit ADS1x15 library to use an ADS1115 module on the Raspberry Pi. This is the relevant part of the code where the error is occurring:

import RPi.GPIO as GPIO
import Adafruit_ADS1x15

GPIO.setmode(GPIO.BCM)
adc = Adafruit_ADS1x15.ADS1115()

Ther error occurs at the last line

The problem is that it is working normally on my Raspberry Pi, while it is giving an error on my client's RPi. I checked the settings on his RPi, and the I2C Bus is enabled there (which was causing the same error on my RPi, and it got fixed as soon as I enabled it).

The error:

enter image description here

It says "Could not determine default I2C bus for the platform.

Any idea why this is happening? The script is running on Raspberry Pi 4 with Raspbian Buster

1 Answer 1

1

Presumably the Adafruit module doesn't know which I2C bus to use.

I suggest you look at the options to the adc = Adafruit_ADS1x15.ADS1115() line and specify bus 1.

Have a look at the ADS1115 class definition in the Adafrut source file for the keyword to use.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.