Advertisement
Guest User

Untitled

a guest
May 16th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. // middle LED = B00000001
  2. // top left = B00000010
  3. // top = B00000100
  4. // top right = B00001000
  5. // bottom left = B00010000
  6. // bottom = B00100000
  7. // bottom right = B01000000
  8. // period = B10000000
  9. const int Data = 8; // The output
  10. const int Latch = 9;
  11. const int Clock = 10; // Goes around the Shift Register
  12. int sequenceog[] = {0,1,2,4,8,16,32,64,128};
  13. int sequence1[] = {126,18,188,182,210,230,238,50,254,246};
  14.  
  15.  
  16. void setup()
  17. {
  18. pinMode(Data, OUTPUT);
  19. pinMode(Latch, OUTPUT);
  20. pinMode(Clock, OUTPUT);
  21. }
  22.  
  23.  
  24. void loop()
  25. {
  26. for(int i = 0; i < 10; i++)
  27. {
  28. digitalWrite(Latch, LOW);
  29. shiftOut(Data, Clock, MSBFIRST, sequence1[i]);
  30. delay(1000);
  31. digitalWrite(Latch, HIGH);
  32. delay(1000);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement