Adafruit ADS1115 cpp

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
mikejr88
 
Posts: 36
Joined: Sat Jul 25, 2009 9:46 am

Adafruit ADS1115 cpp

Post by mikejr88 »

And I believe I have my ADS1115 working with my Pi. :D
Hope this helps someone and I welcome feedback.
ADS1115.tar
(4.04 KiB) Downloaded 192 times
Thanks,
Mike

User avatar
fernandog
 
Posts: 2
Joined: Mon Dec 03, 2012 11:10 pm

Re: Adafruit ADS1115 cpp

Post by fernandog »

Thanks Mike. I am pretty new at this, I downloaded the tarball, ran make, ran main, and this is what I got.

Code: Select all

$ sudo ./main
Failed to write device(-1): Input/output error
Failed to write reg: Input/output error
Difference 0 and 1 = -29555
Failed to write device(-1): Input/output error
Failed to write reg: Input/output error
Difference 2 and 3 = -29300
Failed to write device(-1): Input/output error
Failed to write device(-1): Input/output error
Failed to write reg: Input/output error
Camparator = 0
My addr is ground + addr (x48). Any tips?

Thank you.

User avatar
mikejr88
 
Posts: 36
Joined: Sat Jul 25, 2009 9:46 am

Re: Adafruit ADS1115 cpp

Post by mikejr88 »


User avatar
dkossman
 
Posts: 10
Joined: Mon Dec 03, 2012 11:02 pm

Re: Adafruit ADS1115 cpp

Post by dkossman »

Just ran into the same thing. For a rev 2 (new/latest) Pi, you need to use /dev/i2c-1 instead of /dev/i2c-0
Just edit the two "open" calls in I2C_RW.cpp

Don

User avatar
mikejr88
 
Posts: 36
Joined: Sat Jul 25, 2009 9:46 am

Re: Adafruit ADS1115 cpp

Post by mikejr88 »

Good catch Don, Thanks.
I missed it. I should have read more, in stead of looking at the pictures. :oops:
http://elinux.org/RPi_Low-level_peripherals

Mike

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”