SHARE
TWEET

Scoreboard test

ChipSkylarkk Jun 10th, 2013 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Scoreboards count from 0 - 99
  3. */
  4.  
  5. //Scoreboard shift registers
  6. #define data1 5 //14
  7. #define clock1 7 //11
  8. #define latch1 6 //12
  9.  
  10. //hex values of numbers
  11. byte digitOne[10]= {0x6F, 0x09, 0x73, 0x3B, 0x1D, 0x3E, 0x7C, 0x0B, 0x7F, 0x1F};
  12. byte digitTwo[10]= {0x6F, 0x09, 0x73, 0x3B, 0x1D, 0x3E, 0x7C, 0x0B, 0x7F, 0x1F};
  13.  
  14. void setup()
  15. {
  16.   //set pins to output because they are addressed in the main loop
  17.   pinMode(latch1, OUTPUT);
  18.   pinMode(clock1, OUTPUT);
  19.   pinMode(data1, OUTPUT);
  20. }
  21.  
  22. void loop(){
  23.  int i;
  24.  int j;
  25.   for(int i=0; i<10; i++){
  26.     for(int j=0; j<10; j++){
  27.       digitalWrite(latch1, LOW);
  28.       shiftOut(data1, clock1, MSBFIRST, ~digitTwo[i]); // digitTwo
  29.       shiftOut(data1, clock1, MSBFIRST, ~digitOne[j]); // digitOne
  30.       digitalWrite(latch1, HIGH);
  31.       delay(500);
  32.     }
  33.   }
  34. }
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