Giter Site home page Giter Site logo

Comments (16)

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024

A second option is to read the 4 channels in continuous mode - see examples - and do the math yourself.

from ads1x15.

RobTillaart avatar RobTillaart commented on August 10, 2024

@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.

NovaJeff avatar NovaJeff commented on August 10, 2024

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.

NovaJeff avatar NovaJeff commented on August 10, 2024

Rob I just tried with ADS.setMode(1) in setup() and now handle_conversion() returns true.

from ads1x15.

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024

Example adjusted and renamed.

from ads1x15.

NovaJeff avatar NovaJeff commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

RobTillaart avatar RobTillaart commented on August 10, 2024
  • Found the hardware needed to setup a test.
  • rewrite code for continuous differential with RDY / interrupt
  • test
  • release

from ads1x15.

NovaJeff avatar NovaJeff commented on August 10, 2024

"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.

RobTillaart avatar RobTillaart commented on August 10, 2024

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.

NovaJeff avatar NovaJeff commented on August 10, 2024

Awesome Rob! Thanks for your time on all these nice libraries.

from ads1x15.

RobTillaart avatar RobTillaart commented on August 10, 2024

0.3.2 released.

from ads1x15.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.