more cali fixes
This commit is contained in:
@ -135,12 +135,16 @@ void loop() {
|
||||
|
||||
switch (calibrationState) {
|
||||
case e_CAL_IDLE:
|
||||
for (uint8_t i = 0; i < NUM_OF_CHANNELS; i++) {
|
||||
ads1210[i].setCalOffset(0.0);
|
||||
ads1210[i].setCalFactor(1.0);
|
||||
}
|
||||
calibrationState = e_CAL_RUNNING;
|
||||
break;
|
||||
case e_CAL_RUNNING:
|
||||
calibrationCycleCnt++;
|
||||
for (uint8_t i = 0; i < NUM_OF_CHANNELS; i++) {
|
||||
calibrationValueSum[i] += ads1210[i].getRRaw();
|
||||
calibrationValueSum[i] += ads1210[i].getR();
|
||||
}
|
||||
if (calibrationCycleCnt >= CALIBRATION_CYCLES) {
|
||||
calibrationState = e_CAL_SET;
|
||||
|
Reference in New Issue
Block a user