adafruit / Adafruit_CircuitPython_ADS1x15

CircuitPython drivers for the ADS1x15 series of ADCs.
MIT License
133 stars 58 forks source link

Unable to run Single Ended python program on Pi Zero W #49

Closed kg123456 closed 4 years ago

kg123456 commented 4 years ago

Hi

I just gotten a set of two identical ADS1115 cards with header pins with same error 16 outcome on my Pi Zero W.

Followed instructions to install at https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/i2c-sensors-and-devices and https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15

Did $ sudo i2cdetect -y 1 with following outcome: 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

Next I tried to run the Single Ended program which I named as ads1.py with following error 16 below. Any assistance to connect the ADS1115 appreciated. START $ python3 ads1.py Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 163, in __probe_for_device self.i2c.writeto(self.device_address, b'') File "/home/pi/.local/lib/python3.5/site-packages/busio.py", line 84, in writeto return self._i2c.writeto(address, buffer, stop=stop) File "/home/pi/.local/lib/python3.5/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 38, in writeto self._i2c_bus.write_bytes(address, buffer[start:end]) File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 255, in write_bytes self._select_device(addr) File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 143, in _select_device ioctl(self._device.fileno(), I2C_SLAVE, addr & 0x7F) OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 169, in __probe_for_device self.i2c.readfrom_into(self.device_address, result) File "/home/pi/.local/lib/python3.5/site-packages/busio.py", line 74, in readfrom_into return self._i2c.readfrom_into(address, buffer, stop=stop) File "/home/pi/.local/lib/python3.5/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 44, in readfrom_into readin = self._i2c_bus.read_bytes(address, end-start) File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 154, in read_bytes self._select_device(addr) File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 143, in _select_device ioctl(self._device.fileno(), I2C_SLAVE, addr & 0x7F) OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "ads1.py", line 11, in ads = ADS.ADS1115(i2c) File "/home/pi/.local/lib/python3.5/site-packages/adafruit_ads1x15/ads1x15.py", line 75, in init self.i2c_device = I2CDevice(i2c, address) File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 67, in init self.__probe_for_device() File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 171, in __probe_for_device raise ValueError("No I2C device at address: %x" % self.device_address) ValueError: No I2C device at address: 48 END

ladyada commented 4 years ago

hi you likely have a wiring issue, please contact the vendor you purchased the ADS sensor from for wiring/hardware interface help :)