Comments (16)
It is rather late now (here) and I need to do some reading about the details to see if it is possible. can take a few days.
from ads1x15.
A quick look did not reveal a solution, could code below be an option for you?
uint8_t pair = 01;
void setup()
{
// setup stuff here incl. continuous mode gain etc.
pair = 01;
ADS.requestADC_Differential_0_1();
}
void loop()
{
if (ADS.isReady())
{
if (pair == 01)
{
val_01 = ADS.getValue();
pair = 23;
ADS.requestADC_Differential_2_3();
}
else if (pair == 23)
{
val_23 = ADS.getValue();
pair = 01;
ADS.requestADC_Differential_0_1();
}
}
// do other things here
}
code is a not working snippet, just to get the idea
from ads1x15.
A second option is to read the 4 channels in continuous mode - see examples - and do the math yourself.
from ads1x15.
@NovaJeff
FYI, I created a develop branch as I saw I need to fix the build-CI and some small readme updates.
Also added an example for continuous -differential reading. Could you test that for me?
It is not a PR yet
See - https://github.com/RobTillaart/ADS1X15/tree/develop
from ads1x15.
Hello Rob, that was quick!
Unfortunately, for a reason I don't get yet, the handle_conversion() function never returns true.
To make sure I used a Serial.print debug line right after if (ADS.isReady()) and the line never printed.
I also tried if (!ADS.isBusy) with same outcome, as I expected...
Strange because I really think this approach is clever.
Tried this thru both your develop branch and the code snippet.
from ads1x15.
Rob I just tried with ADS.setMode(1) in setup() and now handle_conversion() returns true.
from ads1x15.
Thanks for testing and fixing.
Although it is not continuous mode, does this method solve your project need?
(I will change the example name and code so it is a working one - ADS_async_differential.ino
from ads1x15.
Example adjusted and renamed.
from ads1x15.
It works great for my project since it's non-blocking and more than fast enough. I really appreciate your swift replies and solutions.
from ads1x15.
Thanx, good to hear it solves the issue. I will investigate if I can get continuous differential working, if so I'll let you know.
Until that investigation is done I keep this issue open as a reminder for me.
from ads1x15.
insight.
In continuous mode the flag that indicates that the ADC is NOT_BUSY is always false.
This results in the isBusy() is always true and isReady() always false.
So to get a real continuous mode version I need to add the RDY (interrupt) pin. (so far theory / hypothesis :)
from ads1x15.
- Found the hardware needed to setup a test.
- rewrite code for continuous differential with RDY / interrupt
- test
- release
from ads1x15.
"In continuous mode the flag that indicates that the ADC is NOT_BUSY is always false."
This explains that then... I'm sure the workaround with RDY / interrupt will be a success.
Thx Rob!
from ads1x15.
Works!
Example code is in the develop branch, and I'll review changes tomorrow to see if it still makes sense :)
Anyway it will be a PR for release 0.3.2
from ads1x15.
Awesome Rob! Thanks for your time on all these nice libraries.
from ads1x15.
0.3.2 released.
from ads1x15.
Related Issues (20)
- How to check if the data rate is correct? HOT 8
- ADS1115 on RP2040 Wire, 0x4B is busy HOT 14
- Arduino Micro and ADS1115 - 860SPS (Only on 1 channel ?) HOT 62
- Error during compiling HOT 5
- ESP32 work on Espressif 1.04 but No on Espressif 2,07 HOT 4
- Synchronous mode very slow HOT 13
- [Query] Example for continuously reading all four channels at max sps? HOT 2
- Differential continuous mode HOT 12
- Cannot change address HOT 11
- ADS1115 value from one channel is being copied to the other HOT 6
- The use of Wire1 is not allowed for ESP32 or ESP8266 HOT 3
- Alternate I2C/TWI library or library abstraction layer HOT 8
- [question] About using ALERT RDY in ADS_continuous_differential.ino example. HOT 8
- getMaxVoltage() does not handle ADS1113 HOT 6
- interrupt driven reads HOT 6
- Differential input and gain for maximum precision. HOT 4
- wire speed HOT 22
- 10-12 Channel Continuous with interrupts. HOT 11
- possible error in the readme HOT 7
- COMP_POL reversed HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ads1x15.