Advertisement
purdyz21

shift register test

Jan 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. /*
  2. * Shift Register Test that will quickly turn on and off the lights
  3. * Zoë Purdy
  4. * 1/16/18
  5. *
  6. */
  7.  
  8.  
  9. const int SER = 8;
  10. const int LATCH = 9;
  11. const int CLK = 10;
  12.  
  13.  
  14.  
  15.  
  16. void setup()
  17. {
  18. pinMode(SER, OUTPUT);
  19. pinMode(LATCH, OUTPUT);
  20. pinMode(CLK, OUTPUT);
  21. digitalWrite(LATCH, LOW);
  22. shiftOut(SER, CLK, MSBFIRST, B11111111);
  23. digitalWrite(LATCH, HIGH);
  24. delay (200);
  25. digitalWrite(LATCH, LOW);
  26. shiftOut(SER, CLK, MSBFIRST, B00000000);
  27. digitalWrite(LATCH, HIGH);
  28.  
  29. }
  30.  
  31. void loop() {
  32. // put your main code here, to run repeatedly:
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement