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;
- const int ButtonPin = 12;
- int buttonState = 0;
- int seq [] = {126, 72, 61, 109, 75, 103, 119, 76, 127, 111};
- void setup() {
- pinMode (SER, OUTPUT);
- pinMode (LATCH, OUTPUT);
- pinMode (CLK, OUTPUT);
- pinMode (ButtonPin, INPUT) ;
- }
- void loop() {
- for (int i=0; i<10; i++)
- buttonState = digitalRead(ButtonPin);
- if (buttonState == HIGH)
- {
- shiftOut (SER, CLK, MSBFIRST, seq [i]);
- digitalWrite (LATCH, HIGH);
- delay (500);
- } else {
- digitalWrite (LATCH, LOW);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement