ADS1115 Library

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
drewmutt
 
Posts: 3
Joined: Mon Jun 17, 2013 9:33 pm

ADS1115 Library

Post by drewmutt »

Hey guys, a couple things.. So, I'm using your "Adafruit_ADS1X15 Library", is there a way to modify the sample rate (without modifying the library / extending the cpp class)? Also, I'm seeing a mismatch between the library and the data sheet. The header has..

Code: Select all

    #define ADS1015_REG_CONFIG_DR_MASK      (0x00E0)  
    #define ADS1015_REG_CONFIG_DR_128SPS    (0x0000)  // 128 samples per second
    #define ADS1015_REG_CONFIG_DR_250SPS    (0x0020)  // 250 samples per second
    #define ADS1015_REG_CONFIG_DR_490SPS    (0x0040)  // 490 samples per second
    #define ADS1015_REG_CONFIG_DR_920SPS    (0x0060)  // 920 samples per second
    #define ADS1015_REG_CONFIG_DR_1600SPS   (0x0080)  // 1600 samples per second (default)
    #define ADS1015_REG_CONFIG_DR_2400SPS   (0x00A0)  // 2400 samples per second
    #define ADS1015_REG_CONFIG_DR_3300SPS   (0x00C0)  // 3300 samples per second
While on the TI datasheet (pg 19)..
Bits [7:5] DR[2:0]: Data rate
These bits control the data rate setting.
000 : 8SPS
001 : 16SPS
010 : 32SPS
011 : 64SPS
100 : 128SPS (default)
101 : 250SPS
110 : 475SPS
111 : 860SPS
Also, on the front page of the datasheet it says..
8SPS to 860SPS

Lemme know fellas! Thanks!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: ADS1115 Library

Post by adafruit_support_mike »

Those values are for the ADS1015, which has a different set of rates.

The library doesn't provide a way to set the sampling rate, so you'll need to modify the code to change the rate. The rate is set as one of the initialization parameters in any of the functions that takes an ADC reading, and you can swap in your own constants pulled from the ADS1115 datasheet.

User avatar
drewmutt
 
Posts: 3
Joined: Mon Jun 17, 2013 9:33 pm

Re: ADS1115 Library

Post by drewmutt »

Groovy, I'll fork your repository and make a ADS1115 version.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”