Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int latch = 13;
- int store = 8;
- int clock = 4;
- int enable = 7;
- int nT1 = 0b00000001;
- int nT2 = 0b00000010;
- void setup()
- {
- pinMode(latch,OUTPUT);
- pinMode(store,OUTPUT);
- pinMode(clock,OUTPUT);
- }
- void loop()
- {
- // Forward
- digitalWrite(latch, LOW);
- digitalWrite(12, HIGH);
- shiftOut(store, clock, MSBFIRST, nT1);
- digitalWrite(latch, HIGH);
- delay(1000);
- // Reverse
- digitalWrite(latch, LOW);
- digitalWrite(12, HIGH);
- shiftOut(store, clock, MSBFIRST, nT2);
- digitalWrite(latch, HIGH);
- delay(1000);
- }
Add Comment
Please, Sign In to add comment