#define clk 4 // SHCP => SRCLK = Shif Register Clock
#define dat 2 // DS => SER = Serial Input
#define latch 3 // STCP => RCLK = Storage Register Clock
void setup() {
ShiftRegisterInit();
}
void loop() {
wr(0x5689);
}
void ShiftRegisterInit() {
pinMode(latch, OUTPUT); // Output Pin Mode
pinMode(dat, OUTPUT); // Output Pin Mode
pinMode(clk, OUTPUT); // Output Pin Mode
}
void wr(uint16_t data) {
digitalWrite(latch, LOW);
shiftOut(dat, clk, LSBFIRST, data>>8&0xff);
shiftOut(dat, clk, LSBFIRST, data&0xff);
digitalWrite(latch, HIGH);
}