Skip to content

Commit

Permalink
Added more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
plutec committed Nov 3, 2020
1 parent a8d6ed9 commit 194a140
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,10 @@ int8_t Configuration::getCalibratedPosition(int8_t pos) {
int8_t to_ret;

if (storage.calibrated_positions) {
Serial.print("Calculate the calibrated value of ");
Serial.println(pos);
#ifdef DEBUG
Serial.print("Calculate the calibrated value of ");
Serial.println(pos);
#endif
if (pos < 30) {
to_ret = pos*storage.calibration[0]/30;
} else if (pos==30) {
Expand All @@ -306,8 +308,10 @@ int8_t Configuration::getCalibratedPosition(int8_t pos) {
} else { // (90 - 100]
to_ret = ((float)(100-storage.calibration[3])/10)*(pos-90)+storage.calibration[3];
}
Serial.print("Calibrated value is: ");
Serial.println(to_ret);
#ifdef DEBUG
Serial.print("Calibrated value is: ");
Serial.println(to_ret);
#endif
return to_ret;
}
return pos;
Expand Down

0 comments on commit 194a140

Please sign in to comment.