const int latchPin = 5; const int clockPin = 6; const int dataPin = 4; int keyPin = 13; int data[16] = {254, 176, 237, 249, 179, 219, 223, 240, 255, 243, 247, 159, 206, 189, 199}; void Displ(int num); void setup () { pinMode(latchPin,OUTPUT); pinMode(clockPin,OUTPUT); pinMode(dataPin,OUTPUT); Displ(0); } int x = -1; int button_old = 1; void loop() { if((digitalRead(keyPin) == LOW)&&(button_old == 1)) { x = x + 1; } Displ(0); Displ(x); if (x > 15) {x = 0;} button_old = digitalRead(keyPin); delay(20); } void Displ(int num) { digitalWrite(latchPin,LOW); shiftOut(dataPin,clockPin,LSBFIRST,data[num]); digitalWrite(latchPin,HIGH); }