Update application.cpp

MrDham-remove-float-calc
MrDham 4 months ago committed by GitHub
parent 9f8e5daa11
commit d534197b9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      Open_Theremin_V3/application.cpp

@ -9,7 +9,8 @@
#include "EEPROM.h" #include "EEPROM.h"
const AppMode AppModeValues[] = {MUTE,NORMAL}; 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 PitchFreqOffset = 700;
const int16_t VolumeFreqOffset = 700; const int16_t VolumeFreqOffset = 700;
const int8_t HYST_VAL = 40; const int8_t HYST_VAL = 40;
@ -399,7 +400,7 @@ pitchfn1 = GetPitchMeasurement();
l_iteration_pitch = 0; l_iteration_pitch = 0;
while ((abs(pitchfn0 - pitchfn1) > CalibrationTolerance) && (l_iteration_pitch < 12)) while ((abs(pitchfn0 - pitchfn1) > PitchCalibrationTolerance) && (l_iteration_pitch < 12))
{ {
SPImcpDAC2Asend(pitchXn0); SPImcpDAC2Asend(pitchXn0);
@ -469,7 +470,7 @@ volumefn1 = GetVolumeMeasurement();
l_iteration_volume = 0; l_iteration_volume = 0;
while ((abs(volumefn0 - volumefn1) > CalibrationTolerance) && (l_iteration_volume < 12)) while ((abs(volumefn0 - volumefn1) > VolumeCalibrationTolerance) && (l_iteration_volume < 12))
{ {
SPImcpDAC2Bsend(volumeXn0); SPImcpDAC2Bsend(volumeXn0);

Loading…
Cancel
Save