const int DATA = 10; // Green Wire
const int LATCH = 11; // Orange Wire
const int CLOCK = 12; // Yellow Wire
void setup() {
// put your setup code here, to run once:
pinMode(DATA, OUTPUT);
pinMode(LATCH, OUTPUT);
pinMode(CLOCK, OUTPUT);
digitalWrite(CLOCK, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
updateShiftRegister(0b11111110);
delay(500);
updateShiftRegister(0x01);
delay(500);
}
// Writes one byte of data into shift register and sets pins
void updateShiftRegister(byte bitData) {
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLOCK, MSBFIRST, bitData);
digitalWrite(LATCH, HIGH);
}