config stuff
This commit is contained in:
10
ads1210.cpp
10
ads1210.cpp
@ -77,11 +77,8 @@ void ADS1210::exec() {
|
||||
value = res.out;
|
||||
|
||||
u = (((float)value) / ((float)V_MAX)) * U_REF;
|
||||
r = ((((float)V_MAX) / ((float)value)) - 1.0) * R_REF;
|
||||
|
||||
if (value == 0) {
|
||||
// fatal(2);
|
||||
}
|
||||
rRaw = ((((float)V_MAX) / ((float)value)) - 1.0) * R_REF;
|
||||
r = (rRaw + m_calOffset) * m_calFactor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,6 +130,9 @@ void ADS1210::begin(uint8_t csPin, uint8_t drdyPin) {
|
||||
setMode(CMR_MD_SelfCalibration);
|
||||
waitForDRdy();
|
||||
// Serial << "done." << endl;
|
||||
|
||||
m_calOffset = 0.0;
|
||||
m_calFactor = 1.0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user