 void loop()
 {
   int p1Event, p2Event;
+
   
   p1Event = p1Button.handle();
   if (!gameOver && p1Event == BUTTON_SHORT) {


void setup()
{
  lcd.begin(16, 2);
  lcd.clear();
  lcd.print("Ping Ponger");
  
  Serial.begin(9600);
  showScore();
  
  p1Button.init();

    numServes = 0;
    showScore();
  }

  delay(20);
}

void showP1Score(int score, boolean serve) {
  int onesIndex = score % 10;
  int tensIndex = score / 10;

  int ones = DigitBytes[onesIndex];
  int tens = DigitBytes[tensIndex];

  if (serve) {
    tens |= 0x80;
  }
  
  digitalWrite(LATCH, LOW);
  shiftOut(DATA, CLK, MSBFIRST, ones);
  shiftOut(DATA, CLK, MSBFIRST, tens);
  digitalWrite(LATCH, HIGH);
}


void showScore()
{
  if (numServes == 2) {
    numServes = 0;
    currentServe = currentServe == 0 ? 1 : 0;
  }

  if (currentServe == 0) {
    showP1Score(p1Score, true);
  } else {
    showP1Score(p1Score, false);
  }
}

void checkForWinner()
{
  if ((p1Score >= 11 || p2Score >= 11) && abs(p1Score - p2Score) >= 2) {

    if (p1Score > p2Score) {
      p1Win = true;
    } else {
      p2Win = true;
    }
    victorySong.play();
    gameOver = 1;
  }
}
