Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int latchPin = 9;
- int dataPin = 8;
- int clockPin = 10;
- int dato = 0;
- int waitFor = 200;
- int first = 0;
- int second = 0;
- void setup() {
- pinMode (dataPin, OUTPUT);
- pinMode (clockPin, OUTPUT);
- pinMode (latchPin, OUTPUT);
- }
- void loop()
- {
- lightLeds (0b00000000, 0b00000000);
- lightLeds (0b00000001, 0b00000000);
- lightLeds (0b00000011, 0b00000000);
- lightLeds (0b00000111, 0b00000000);
- lightLeds (0b00001111, 0b00000000);
- lightLeds (0b00011111, 0b00000000);
- lightLeds (0b00111111, 0b00000000);
- lightLeds (0b01111111, 0b00000000);
- lightLeds (0b11111111, 0b00000000);
- lightLeds (0b11111111, 0b00000001);
- lightLeds (0b11111111, 0b00000011);
- lightLeds (0b11111111, 0b00000111);
- lightLeds (0b11111111, 0b00001111);
- lightLeds (0b11111111, 0b00011111);
- lightLeds (0b11111111, 0b00111111);
- lightLeds (0b11111111, 0b01111111);
- lightLeds (0b11111111, 0b11111111);
- //
- lightLeds (0b11111111, 0b11111111);
- lightLeds (0b11111111, 0b01111111);
- lightLeds (0b11111111, 0b00111111);
- lightLeds (0b11111111, 0b00011111);
- lightLeds (0b11111111, 0b00001111);
- lightLeds (0b11111111, 0b00000111);
- lightLeds (0b11111111, 0b00000011);
- lightLeds (0b11111111, 0b00000001);
- lightLeds (0b11111111, 0b00000000);
- lightLeds (0b01111111, 0b00000000);
- lightLeds (0b00111111, 0b00000000);
- lightLeds (0b00011111, 0b00000000);
- lightLeds (0b00001111, 0b00000000);
- lightLeds (0b00000111, 0b00000000);
- lightLeds (0b00000011, 0b00000000);
- lightLeds (0b00000001, 0b00000000);
- lightLeds (0b00000000, 0b00000000);
- }
- void lightLeds (int second, int first)
- {
- digitalWrite (latchPin, LOW);
- shiftOut (dataPin, clockPin, LSBFIRST, first);
- shiftOut (dataPin, clockPin, LSBFIRST, second);
- digitalWrite (latchPin, HIGH);
- delay (waitFor);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement