I have Arduino Uno from the Starter Kit. I have been following Paul McWorther Arduino tutorials on You Tube. I tried the exercise on using 74HC595 Shift Register to control 8 LEDs.
I have used the circuit digram from the tutorial but added a 100micro farad capacitor at IC pin 16 to GND, from reading other forums.
int latchPin=2;
int clockPin=3;
int dataPin=4;
int dt=100;
byte LEDs=0B10000000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(latchPin,OUTPUT);
pinMode(dataPin,OUTPUT);
pinMode(clockPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,LSBFIRST,LEDs);
digitalWrite(latchPin,HIGH);
delay(dt);
}
When uploaded the LEDs light sequentially and all remain HIGH.
if I reverse the LEDs order to =0B00000001; the they go out sequentially. They do this to the delay time.
Can anyone see where I am going wrong? Or is there something I don't understand about the 74HC595.