Ive been playing about with the circuit and code that came with my uno on http://www.oomlout.com/a/products/ardx/circ-05
I have the circuit set up as it is but in order to get a better idea of whats going on with the shift register I altered my loop() to
int delayt=1000;
updateLEDs(3);
delay(delayt);
updateLEDs
void updateLEDs(int value){
digitalWrite(latch, LOW); //Pulls the chips latch low
shiftOut(data, clock, MSBFIRST, value); //Shifts out the 8 bits to the shift register
digitalWrite(latch, HIGH); //Pulls the latch high displaying the data
}
When this activates my first 2 leds light up but if I change updateLEDs to 4 the 3rd led lights up and all the others are off. If its 5 the 1st and the 3rd light by themselves and 6 leds 2 and 3 light up. What is happening in shiftout that has this effect? Why do the lights have this pattern, if the shift register simply pushes the bit from each output to the next wouldnt a value of 6 light up the 6th led?