const int PIN_SER = 8;
const int PIN_LATCH = 9;
const int PIN_CLK = 10;
byte patterns[] = {
//ABCDEFGd
0b00000010,//0.
0b10011110,//1.
0b00100100,//2.
0b00001100,//3.
0b10011000,//4.
0b01001000,//5.
0b01000000,//6.
0b00011110,//7.
0b00000000,//8.
0b00001000,//9.
0b00000011,//0
0b10011110,//1
0b00100101,//2
0b00001101,//3
0b10011001,//4
0b01001001,//5
0b01000001,//6
0b00011111,//7
0b00000001,//8
0b00001001//9
};
void setup() {
pinMode( PIN_SER, OUTPUT );
pinMode( PIN_LATCH, OUTPUT );
pinMode( PIN_CLK, OUTPUT );
}
void loop() {
for ( int i=0; i<20; i++ ) {
digitalWrite( PIN_LATCH, LOW );
shiftOut( PIN_SER, PIN_CLK, LSBFIRST, patterns[i] );
digitalWrite( PIN_LATCH, HIGH );
delay(1000);
}
}