Hello
I'm trying to light the led 1 on 74HC595 pin and the rest gets deleted and then delete the led 1 and light only led 2 that is in pin 2 of 74HC595 , but problem I'm having is that all LEDs are lit together, what could be wrong?
#define latchPin 5
#define clockPin 6
#define dataPin 4
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop() {
digitalWrite(latchPin, HIGH);
shiftOut(dataPin, clockPin, LSBFIRST, 0b10000000);
digitalWrite(latchPin, LOW);
delay(1000);
digitalWrite(latchPin, HIGH);
shiftOut(dataPin, clockPin, LSBFIRST, 0b01000000);
digitalWrite(latchPin, LOW);
delay(1000);
}
Thank you