Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function adc.begin(drate, gain, bufferenable) works, while adc.begin() doesn't #7

Open
jurc192 opened this issue Feb 14, 2022 · 0 comments

Comments

@jurc192
Copy link

jurc192 commented Feb 14, 2022

When using adc.begin() without any parameters I only get "inf" outputs from the sensor (sensor clipped, not reacting to changes in light, always infinite). If I use begin function with specified drate, gain and bufferenable everything works okay.
Any idea what might be broken?

Code I use:

#include <ADS1256.h>
#include <SPI.h>

float clockMHZ = 8.0;
float vRef = 2.5;

ADS1256 adc(clockMHZ,vRef,false);
float sensor1;

void setup()
{
  Serial.begin(9600);
//   adc.begin(ADS1256_DRATE_30000SPS, ADS1256_GAIN_1, false);   // this works ok
  adc.begin();    // this doesn't work, always infinite
  adc.setChannel(0,1);
}

void loop()
{ 
  adc.waitDRDY();
  sensor1 = adc.readCurrentChannel();
  Serial.println(sensor1, 10);
}
@jurc192 jurc192 changed the title Function void begin(unsigned char drate, unsigned char gain, bool bufferenable) works, while adc.begin() doesn't Function adc.begin(drate, gain, bufferenable) works, while adc.begin() doesn't Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant