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.
ADS1X15 continuous mode
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ADS1X15 continuous mode
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
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
- Jtknep
- Posts: 2
- Joined: Fri May 28, 2021 1:02 pm
Re: ADS1X15 continuous mode
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; ?
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: ADS1X15 continuous mode
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.
Please be positive and constructive with your questions and comments.