byte outs[2];
#define clock 8
#define data 6
#define latch 7
#define oe 5
void setup() {
pinMode(clock, OUTPUT);
pinMode(data, OUTPUT);
pinMode(latch, OUTPUT);
pinMode(oe, OUTPUT);
digitalWrite(oe, HIGH);
outs[0] = 0b11111111; outs[1] = 0b00000000;
func_out();
digitalWrite(oe, LOW);
delay(100);
}
void loop() {
outs[0] = 0b11110000; outs[1] = 0b00001111;
func_out();
delay(3000);
outs[0] = 0b00001111; outs[1] = 0b11110000;
func_out();
delay(3000);
outs[0] = 0b11110000; outs[1] = 0b00001111;
func_out();
delay(3000);
outs[0] = 0b00001111; outs[1] = 0b11110000;
func_out();
delay(3000);
outs[0] = 0b11111111; outs[1] = 0b00000000;
func_out();
delay(2000);
outs[0] = 0b11111110; outs[1] = 0b10000000;
func_out();
delay(1000);
outs[0] = 0b11111101; outs[1] = 0b01000000;
func_out();
delay(1000);
outs[0] = 0b11111011; outs[1] = 0b00100000;
func_out();
delay(1000);
outs[0] = 0b11110111; outs[1] = 0b00010000;
func_out();
delay(1000);
outs[0] = 0b11101111; outs[1] = 0b00001000;
func_out();
delay(1000);
outs[0] = 0b11011111; outs[1] = 0b00000100;
func_out();
delay(1000);
outs[0] = 0b10111111; outs[1] = 0b00000010;
func_out();
delay(1000);
outs[0] = 0b01111111; outs[1] = 0b00000001;
func_out();
delay(1000);
}
void func_out(){
digitalWrite(latch, LOW);
shiftOut(data, clock, LSBFIRST, outs[1]);
shiftOut(data, clock, LSBFIRST, outs[0]);
digitalWrite(latch, HIGH);
}