   // Blank p2 score
 
   // Turn off button lights
-  digitalWrite(P1LIGHTPIN, LOW);
-  digitalWrite(P2LIGHTPIN, LOW);
+  digitalWrite(BUTTONLIGHTPIN, LOW);
 }
 
  void wakeup()
  {
+   if (!sleeping)
+     return;
+   
    sleeping = false;
    
    showScore();
    
-   digitalWrite(P1LIGHTPIN, HIGH);
-   digitalWrite(P2LIGHTPIN, HIGH);
+   digitalWrite(BUTTONLIGHTPIN, HIGH);
  }
 
 

}

// Game Logics
int p1Score = 0;
int p2Score = 0;
int currentServe = 0; // p1 = 0, p2 = 1
int numServes = 0;
int gameOver = 0;
int victoryBlinkCounter = 0;

unsigned long lastActivityTime;

boolean p1Win = false;
boolean p2Win = false;
boolean blinkToggle = true;
boolean sleeping = false;

Button p1Button(P1PIN);
Button p2Button(P2PIN);
VictorySong victorySong(SPEAKERPIN);

void setup()
{
  pinMode(LATCH, OUTPUT);
  pinMode(CLK, OUTPUT);
  pinMode(DATA, OUTPUT);

  pinMode(P1LIGHTPIN, OUTPUT);
  pinMode(P2LIGHTPIN, OUTPUT);

  digitalWrite(P1LIGHTPIN, HIGH);
  digitalWrite(P2LIGHTPIN, HIGH);
  
  showScore();
  
  p1Button.init();
  p2Button.init();
  victorySong.init();
  lastActivityTime = millis();
}


void loop()
{
  int p1Event, p2Event;

  if ((millis() - lastActivityTime) > INACTIVEMILLIS) {
    goToSleep();
  } else {
    wakeup();
  }
  
  if (gameOver) {
    victoryBlinkCounter++;


  p1Win = false;
  p2Win = false;
  gameOver = 0;
  numServes = 0;
}



