 
 // the event counter
 volatile int eventCounter = 0;
-volatile int LoopCounter = 0;
+//volatile int LoopCounter = 0;
 
 char buf [16]; // used to concatenate strings & numerical data for display on SanSmart LCD
          

  if (buttonPressed==KEYPAD_LEFT) buttons += 4;
  if (buttonPressed==KEYPAD_RIGHT) buttons += 8;
  if (buttonPressed==KEYPAD_SELECT) buttons += 16;
  bool Same = true;
  int i = 0;
  NubtnVal = buttons;
  // Switch debounce code to help ensure a true button reading
  while(i<6 && NubtnVal == buttons){
    buttonPressed = Keypad.button();
    buttons = 0; 
    if (buttonPressed==KEYPAD_UP) buttons += 1;

// ############ End O-Scope Mode #################    
    
  
   ScanButtons();
//   if (UpdtDis){
//    LoopCounter++;
//   }
   long TotalRunTime = calcruntime();
  } //end of 1st while loop
 //kill the PWM signal
