SHARE
TWEET

chaseReverse

ChipSkylarkk Jun 20th, 2013 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void chaseReverse(uint32_t c, uint8_t wait)
  2. {
  3.   lcd.clear();
  4.  
  5.   for(i; i >= 0; i--)
  6.   {
  7.     if(digitalRead(player1) == LOW)
  8.     {
  9.       cheat = 'Y';
  10.     }
  11.     strip.setPixelColor(i, c); // Set new pixel 'on'
  12.     strip.show();              // Refresh LED states
  13.     strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
  14.     delay(wait);
  15.    
  16.     if(i < 2 && cheat != 'Y')
  17.     {
  18.       int BbuttonState = digitalRead(player1);
  19.       if(BbuttonState == LOW)
  20.       {
  21.         turn = 'A';
  22.         flag = 'F';
  23.         return;
  24.       }
  25.     }
  26.   }
  27.   player2Points++;
  28.   digitalWrite(latch1, LOW);
  29.   shiftOut(data1, clock1, MSBFIRST, ~digitOne[player1Points]);
  30.   shiftOut(data1, clock1, MSBFIRST, ~digitTwo[player2Points]);
  31.   digitalWrite(latch1, HIGH);
  32.   strip.show();
  33.   if(player2Points < score)
  34.   lcd.print("PLAYER 2 SCORES!");
  35.  
  36.   //Turn on player2 LEDs
  37.   digitalWrite(latch3, LOW);
  38.   shiftOut(data3, clock3, MSBFIRST, 0);  
  39.   digitalWrite(latch3, HIGH);
  40.  
  41.   flag = 'S';
  42.   cheat = 'N';
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top