ADS1X15 continuous mode

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Jtknep
 
Posts: 2
Joined: Fri May 28, 2021 1:02 pm

ADS1X15 continuous mode

Post by Jtknep »

I’m successfully using the Adafruit_ADS1X15 library written by Kevin Townsend. The ADS1015 is connected to an ESP32 development board. Can anyone tell me how to put the device into continuous mode? It might help me to measure short duration pulse amplitudes.
Separately, in case the author is interested in minor corrections, the documentation says the default sample rate is 1600 sps but mine is reporting 128 sps in the single shot mode.
Thanks for reading.

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

Re: ADS1X15 continuous mode

Post by adafruit_support_mike »

The library doesn't support continuous mode, but you can add it. Follow the same process used in the function .readADC_SingleEnded(), but use th constant ADS1X15_REG_CONFIG_MODE_CONTIN instead of ADS1X15_REG_CONFIG_MODE_SINGLE in the configuration:

https://github.com/adafruit/Adafruit_AD ... #L119-L124

Then loop around the section that waits for the conversion to be done before reading a value:

https://github.com/adafruit/Adafruit_AD ... #L154-L159

User avatar
Jtknep
 
Posts: 2
Joined: Fri May 28, 2021 1:02 pm

Re: ADS1X15 continuous mode

Post by Jtknep »

Thanks for the prompt reply! Not surprisingly, I’m still having problems. I’m new to this. When you say “loop around the section” do you mean for me to comment out those two lines of code? Also, is there a need to change this line: config |= ADS1X15_REG_CONFIG_OS_SINGLE; ?

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

Re: ADS1X15 continuous mode

Post by adafruit_support_mike »

If the ADC is operating in continuous mode, it makes sense to capture readings as soon as they're available. As soon as you get a reading, you jump back to watching conversionComplete() until the next reading is ready.

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

Return to “Other Arduino products from Adafruit”