I an a total beginner in both Arduino and electronics, and this is my first question here.
I was following a series of tutorial which came along a beginner kit (from Smraza)
It's about connecting 8 LED to a Shift Register. I have done and redone the connections from this tutorial, and from others in the net - including the one on Arduino web site here https://www.arduino.cc/en/Tutorial/ShiftOut
But I couldn't achieve anything. Nothing seems to come out from the IC. No LED turn on.
So my questions are :
Is there something strange in my connections
Is the code OK
How can I test if there isn't a problem with the Shift Register itself ?
Attached is a photo of my setup, and below a copy of the code (which is actually a copy of the tutorial code)
Unless I missed something that means only 0s are sent to the LEDs so none of them will ever light. Did I miss somewhere that some of the outputs are set to 1?
PerryBebbington:
Unless I missed something that means only 0s are sent to the LEDs so none of them will ever light. Did I miss somewhere that some of the outputs are set to 1?
You are right, I'm sorry, I was under the impression that bitSet would alter the variable, obviously, it does not.Edit: it does. But then what did the OP mean? > JeromeBoulbes: > and below a copy of the code (which is actually a copy of the tutorial code)
I don't know. I read it quickly, noticed the 0, couldn't see anywhere that set the LEDs to anything other than 0, couldn't see anything wrong with the wiring so make the comment and hoped someone else might pick up something I missed.
bitSet is supposed to write a 1 to the nth bit of variable x, so that does look right:
bitSet(x, n);
Try doing a Serial.println with the value of leds whenever you do a shiftOut, then you can see if that value is correct.
If it is, you have probably connected something wrong. If it's not, you have probably coded something wrong.
Check that the wire to the SRCLR_ input is actually making contact. It looks like it might be short.
I think you may have RCLK and SRCLK mixed up. Try this and see what happens (it will not hurt the circuit if I'm wrong):
Hello Everyone . Thankyou for all the suggestions. Even if it doesnt works, it still good study !
For the leds variable hint, I changed the loop code to the following. Am I right to assume that if all connections are right, this would light all LEDs ?