From d534197b9f2334cb1e885137e25af797ef7f00b8 Mon Sep 17 00:00:00 2001 From: MrDham Date: Thu, 25 Jul 2024 20:51:23 +0200 Subject: [PATCH] Update application.cpp --- Open_Theremin_V3/application.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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);