calibration fixes

This commit is contained in:
hg
2014-11-20 22:43:06 +01:00
parent 80a394d651
commit b6ad21f3f6
4 changed files with 74 additions and 59 deletions

View File

@ -58,12 +58,12 @@ uint8_t ADS1210::readRegister(const uint8_t regAddr) const {
return res;
}
void ADS1210:setCalFactor(float calFactor) {
void ADS1210::setCalFactor(float calFactor) {
m_calFactor = calFactor;
Config::setFloat(m_eepromAddr + CONFIG_CAL_FACTOR, m_calFactor);
}
void ADS1210:setCalOffset(float calOffset) {
void ADS1210::setCalOffset(float calOffset) {
m_calOffset = calOffset;
Config::setFloat(m_eepromAddr + CONFIG_CAL_OFFSET, m_calOffset);
}
@ -154,8 +154,8 @@ void ADS1210::begin(uint8_t csPin, uint8_t drdyPin, bool initializeConfig, int e
waitForDRdy();
// Serial << "done." << endl;
calOffset = Config::getFloat(m_eepromAddr + CONFIG_CAL_OFFSET);
calFactor = Config::getFloat(m_eepromAddr + CONFIG_CAL_FACTOR);
m_calOffset = Config::getFloat(m_eepromAddr + CONFIG_CAL_OFFSET);
m_calFactor = Config::getFloat(m_eepromAddr + CONFIG_CAL_FACTOR);
}