config stuff

This commit is contained in:
Wolfgang Hottgenroth
2014-11-15 23:42:31 +01:00
parent c687aff175
commit ca26284cf2
5 changed files with 102 additions and 6 deletions

View File

@ -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;
}