Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // middle LED = B00000001
- // top left = B00000010
- // top = B00000100
- // top right = B00001000
- // bottom left = B00010000
- // bottom = B00100000
- // bottom right = B01000000
- // period = B10000000
- const int Data = 8; // The output
- const int Latch = 9;
- const int Clock = 10; // Goes around the Shift Register
- int sequenceog[] = {0,1,2,4,8,16,32,64,128};
- int sequence1[] = {126,18,188,182,210,230,238,50,254,246};
- void setup()
- {
- pinMode(Data, OUTPUT);
- pinMode(Latch, OUTPUT);
- pinMode(Clock, OUTPUT);
- }
- void loop()
- {
- for(int i = 0; i < 10; i++)
- {
- digitalWrite(Latch, LOW);
- shiftOut(Data, Clock, MSBFIRST, sequence1[i]);
- delay(1000);
- digitalWrite(Latch, HIGH);
- delay(1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement