 
 boolean presentValue = false;
 
-String EnteredFreqString, TuningFreqString;
-String DisplayValueLstring;
+ String EnteredFreqString, TuningFreqString;
+ String DisplayValueLstring;
 
 int i;
 

char input; //buffer for input characters for calculations
// char dataPrintout[10];

float tuningFreqCalc = 0;   // float for value C calculation
float KHz;                  // KHz constant
float PlanckTime;           // Planck constant
float pi;                   // π constant
float valueC1 = 0;           // calculated value C float
float valueCEffective = 0;  // calculated value C float
float valueL = 0;           // calculated value L float
float valueC1Corr = 0;      // calculated value C1 float
float valueC2Corr = 0;      // calculated value C1 float
float valueLcorr = 0;       // calculated value L float
float Cmult;                // constant multiplier to calculate C value
float Lmult;                // constant multiplier to calculate L value
float valueRotateC1;
float valueRotateC2;
float valueRotateL;

  keypad.addEventListener(keypadEvent);             //add an event listener for this keypad
}

//void SetFrequencyStage1() {
	// STAGE 1 tuning process
//	calculateC();                                     // calculate C value at selected frequency
//	calculateStepsC();                                // calculate steps needed to move C to value C
//	CmoveStage1();                                    // send command to nano to move motor "C" to C step value
//	calculateL();                                     // calculate L value at given frequency and C value
//	calculateStepsL();                                // calculate steps needed to move C to value L
//	LmoveStage1();                                    // send command to nano to move motor "L" to L step value
//	EraseDisplayC1(), EraseDisplayL();                 // clear previous values L and C at display
//	displayC1(), displayL();                           // display current values L and C at display
//	mechSetPosition(round (valueRotateL), round (valueRotateC1), round (valueRotateC2));
	// End STAGE 1 tuning process
//}

// Pre-STAGE 1 (coarse tuning process) cleanups and displays - will be used later
void SetFrequency() {                               // when # pressed - sets frequency value at the bottom of the screen
  eraseFreqTopScreen();                             // clear previously entered drequesncy at display top
  eraseEnteredFrequency();                          // clear entered frequency at display bottom  
  displayFreqTopScreen();                           // display desired frequesncy at display top
//  SetFrequencyStage1();
}


void incL(float diff) {                             // rotate motor L with number of steps
  EraseDisplayL();
  valueRotateL = valueRotateL + diff;
  displayL();
  mechSetPosition(round (valueRotateL), round (valueRotateC1), round (valueRotateC2));
}

void incC1(float diff) {                            // rotate motor C1 Cold with number of steps
  EraseDisplayC1();
  valueRotateC1 = valueRotateC1 + diff;
  displayC1();
  mechSetPosition(round (valueRotateL), round (valueRotateC1), round (valueRotateC2));
}

void incC2(float diff) {                            // rotate motor C2 Hot with number of steps
  EraseDisplayC2();
  valueRotateC2 = valueRotateC2 + diff;
  displayC2();
  mechSetPosition(round (valueRotateL), round (valueRotateC1), round (valueRotateC2));
}

// void incLCorr(float diff) {
//    if (tuningFreqCalc != 0.0) {
//      valueLcorr = valueLcorr + diff;
//      SetFrequencyStage1();
//    }
//}

//void incC1Corr(float diff) {
//    if (tuningFreqCalc != 0.0) {
//      valueC1Corr = valueC1Corr + diff;
//      SetFrequencyStage1();
//    }
//}

//void incC2Corr(float diff) {
//    if (tuningFreqCalc != 0.0) {
//      valueC2Corr = valueC2Corr + diff;
//      SetFrequencyStage1();
//    }
//}

void eraseFreqTopScreen() {                      // erases frequency value from top of display
  TFTscreen.stroke(0, 20, 30);
