I'm trying to get the ADS1015 breakout working with Raspbian. I have i2c working, and it can detect the ADS1015:
Code: Select all
pi@raspberrypi ~/analog/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15 $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Code: Select all
pi@raspberrypi ~/analog/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15 $ sudo python ads1015_example.py
Error accessing 0x48: Check your I2C address
Error accessing 09x48: Check your I2C address
Traceback (most recent call last):
File "ads1015_example.py", line 13, in <module>
result = adc.readADCSingleEnded(0)
File "/home/pi/analog/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15/Adafruit_ADS1x15.py", line 135, in readADCSingleEnded
return ( ((result[0] << 8) | (result[1] & 0xFF)) >> 4 )
TypeError: 'int' object has no attribute '__getitem__'
Thanks,
Matt