I am using the ADS1015, which is a 12-bit ADC from adafruit. I have it hooked up to a Logic Level Converter using I2C to communicate to the Pi. I have two sensors hooked up to the I2C device, so I need to change the address of the ADS1015 to read from both sensors because they currently have the same address (0x48). I am using the Adafruit ads1x15 python library right now, and I am wondering if there is an easy way to change the I2C address of the ADS1015 in my code.
Here's my code so far:
from smbus import SMBus import board import busio import time import adafruit_ads1x15.ads1015 as ADS from adafruit_ads1x15.analog_in import AnalogIn from adafruit_ads1x15.ads1015 import Mode i2cbus_1 = SMBus(1) i2cbus_2 = busio.I2C(board.SCL, board.SDA) ads = ADS.ADS1015(i2cbus_2) chan = AnalogIn(ads, ADS.P0)