Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int SER =8;
- const int LATCH =9;
- const int CLK =10;
- int seq [] = {1, 2, 4, 8, 16, 32, 64, 128, 64, 32, 16, 8, 4, 2, 1};
- void setup() {
- pinMode (SER, OUTPUT);
- pinMode (LATCH, OUTPUT);
- pinMode (CLK, OUTPUT);
- }
- void loop() {
- for (int i= 0; i<15; i++)
- {
- digitalWrite (LATCH, LOW);
- shiftOut (SER, CLK, MSBFIRST, seq [i]);
- digitalWrite (LATCH, HIGH);
- delay (100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement