diff --git a/Open_Theremin_V3/application.cpp b/Open_Theremin_V3/application.cpp index 0a70930..87afd2b 100644 --- a/Open_Theremin_V3/application.cpp +++ b/Open_Theremin_V3/application.cpp @@ -9,7 +9,8 @@ #include "EEPROM.h" const AppMode AppModeValues[] = {MUTE,NORMAL}; -const int16_t CalibrationTolerance = 15; +const int16_t PitchCalibrationTolerance = 15; +const int16_t VolumeCalibrationTolerance = 21; const int16_t PitchFreqOffset = 700; const int16_t VolumeFreqOffset = 700; const int8_t HYST_VAL = 40; @@ -399,7 +400,7 @@ pitchfn1 = GetPitchMeasurement(); l_iteration_pitch = 0; -while ((abs(pitchfn0 - pitchfn1) > CalibrationTolerance) && (l_iteration_pitch < 12)) +while ((abs(pitchfn0 - pitchfn1) > PitchCalibrationTolerance) && (l_iteration_pitch < 12)) { SPImcpDAC2Asend(pitchXn0); @@ -469,7 +470,7 @@ volumefn1 = GetVolumeMeasurement(); l_iteration_volume = 0; -while ((abs(volumefn0 - volumefn1) > CalibrationTolerance) && (l_iteration_volume < 12)) +while ((abs(volumefn0 - volumefn1) > VolumeCalibrationTolerance) && (l_iteration_volume < 12)) { SPImcpDAC2Bsend(volumeXn0);