  //kill the PWM signal
   detachInterrupt(InterruptId);
   digitalWrite (PWMpin, LOW);
-// pinMode (GPIOpin, OUTPUT) ; //configure pin 1 as a simple output pin
-// digitalWrite (GPIOpin, LOW); //set/force pin 1 output to ground [low]
-// digitalWrite (GPIOpinSlow, LOW); //set/force pin 4 output High[Under Speed LED off]
-// digitalWrite (GPIOpinOK, LOW); //set/force pin 5 output  High[Speed Ok LED off]
-// digitalWrite (GPIOpinFast, LOW); //set/force pin 6 output  High[Over Speed LED off]
-
-
- //Serial1.print("All Done!\n");
- //setBacklightColour (0);
  lcd.clear();
  lcd.setCursor(0,0); //lcd.setCursor(pos,line)
  sprintf (buf, "Program Stopped");

  return RunTime;
}
// -------------------------------------------------------------------------















{
  byte Divisor;
  //Serial1.begin(9600); // enable when [Leonardo] bluetooth diagnostic is needed
  Serial.begin(9600);  // enable when/if diagnostic is needed
   // set up the lcd's number of columns and rows: 
  lcd.begin(16, 2);
  //calcrpm =  (SampleCnt*1000000*60)/period;//Formula used in interrupt routine to estimate current Spindle RMPM
