I am 6th grader and started learning arduino. Check out my website www.aaravpatel.com
I learned basic things and now I am trying to learn shift register. I think I understand it correctly and my circuit is also correct. I have attached 8 leds to all 8 outputs of the shift register.
if I give input as 0b10101010, all odd leds will lit.
if I give input as 0b01010101, all even leds will lit.
but if I give both with delay of 1 second, only odd leds lit.
I tried to give different input and I confirm that all led individually works fine as per input but it does not work as expected when I try to change input after delay. Below is my program.
What shift register are you using? It may be that your shift register clocks data on the rising edge of the clock and you have to take care of that as referenced in the documentation for shiftOut() here
The shiftOut example code (shiftOut() - Arduino Reference) should work fine with the 74HC595, so I would expect a hardware problem. Did you double-check the connections?
I don't think so. Some code works, some does not. For example, If I try code from below link, only pingpong function works but not other. I have ordered new shift registers and now I will order new arduino board. I am really confused at the moment.
Please stop wasting our time. If you are serious about wanting help, read the forum guide in the sticky post. That will tell you that you should post a schematic so we can see what components you are using and how they are connected. And that you should post complete code, using code tags.
Oh hmm. Sorry, I am new to programming/arduino/forum and what not. I am just 6th grader. I got this circuit working now but for future questions, I will follow guidelines going forward.