I use an ads1115 to get values from an analogic sensor to a raspberry pi 3 but I'm having a hard time figuring out how to get them from python.
I use the SMBus library to get the i2c values but I can't find how to actually get the analog 0 AIN0
channel values. I found the i2c address for the ads1115 to be 0x48
but I can't find the address for the AIN0 channel, thus I don't have the second argument for the command smbus.read_byte_data(0x48, ???)
and I tried some addresses like 0x00
, 0x01
but it always gives me the same values even tho the sensor values should be changing.Here's my code :
from smbus import SMBus
import RPi.GPIO as GPIO
import time
def main():
i2cbus = SMBus(1)
i2caddress = 0x48
value = i2cbus.read_byte_data(0x48, """dont't know""")
if __name__ == "__main__":
main()