Giter Site home page Giter Site logo

Comments (2)

tdicola avatar tdicola commented on June 12, 2024

The error looks like the I2C device can't be found, possibly because the bus or wiring aren't right. One thing to check, take a look at the I2C on Pi guide to make sure all the I2C modules, etc. are enabled: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c Also run both these commands with the device connected to inspect the I2C buses:

sudo i2cdetect -y 0
sudo i2cdetect -y 1

One of them should show a device with address 0x48, the default address of the ADS1115. If you don't see either of them with a 48 value then double check the wiring, power, ground, etc. are good. You'll need to make sure i2cdetect sees the device before the python code will work.

Then depending on the command that worked, the bus number to use is the value 0 or 1 in the working command. For example if i2cdetect -y 1 shows the 48 device then you want to use I2C bus 1. To change the bus you can modify the constructor right below those comments to look like:

self.i2c = Adafruit_I2C(address, busnum=1)

Swap the value 1 in the busnum parameter to 0 if you see your device on bus 0 with i2cdetect. Give that a shot and let me know if you still see issues.

from adafruit-raspberry-pi-python-code.

tdicola avatar tdicola commented on June 12, 2024

Cleaning up old issues and I'll close this one for now. If you still run into issues, feel free to post on forums.adafruit.com where more folks can help troubleshoot.

from adafruit-raspberry-pi-python-code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.