Guest User

Untitled

a guest
May 26th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. int latch = 13;
  2. int store = 8;
  3. int clock = 4;
  4. int enable = 7;
  5. int nT1 = 0b00000001;
  6. int nT2 = 0b00000010;
  7.  
  8. void setup()
  9. {
  10. pinMode(latch,OUTPUT);
  11. pinMode(store,OUTPUT);
  12. pinMode(clock,OUTPUT);
  13. }
  14.  
  15. void loop()
  16. {
  17. // Forward
  18. digitalWrite(latch, LOW);
  19. digitalWrite(12, HIGH);
  20. shiftOut(store, clock, MSBFIRST, nT1);
  21. digitalWrite(latch, HIGH);
  22. delay(1000);
  23.  
  24. // Reverse
  25. digitalWrite(latch, LOW);
  26. digitalWrite(12, HIGH);
  27. shiftOut(store, clock, MSBFIRST, nT2);
  28. digitalWrite(latch, HIGH);
  29. delay(1000);
  30. }
Add Comment
Please, Sign In to add comment