i want to connect 10+ shift registers together with 2 rgb leds

im not exactly sure what im doing... but some how i can get all the leds to turn on. by altering some code i found when i google " shift registers arduino"

i need help with coding. i swear if i can get the coding down... as j.p. from grandmas boys says it "people will bow to it"

help me out thanks

ben

So you have 10 shift registers daisy-chained together and 6 of the 8 outputs in each 8-bit shift register controls the three colors of two RGB LEDs.

byte color[20];  // Pattern of colors to display, three bits per color.
digitalWrite(latchPin, LOW);
for (int register = 0; register < 10; register++) {
    shiftOut(clockPin, dataPin, color[register*2]<<4 + color[register*2+1]);  // Send colors to two RGB LEDs
}
digitalWrite(latchPin,HIGH);

yes exactly!

i understand that i cant control the light all at the same time but i can trick the human eye my shifting. so if i shift blue on each s.register with no delay will it look like blue is all on?

thanks

i understand that i cant control the light all at the same time

Wrong you can controll them individually at the same time.
I don't see any decoupling capacitors on that circuit so it will not be stable.

is there a way you can maybe write a full basic code for me?

im guessing using

shiftout

this is a prototype once i master the code im gunna surface mount everything to minimize space. then i will buy and add the cap's.

thanks!

johnwasser:
So you have 10 shift registers daisy-chained together and 6 of the 8 outputs in each 8-bit shift register controls the three colors of two RGB LEDs.

byte color[20];  // Pattern of colors to display, three bits per color.

digitalWrite(latchPin, LOW);
for (int register = 0; register < 10; register++) {
    shiftOut(clockPin, dataPin, color[register2]<<4 + color[register2+1]);  // Send colors to two RGB LEDs
}
digitalWrite(latchPin,HIGH);

can you write a full code for me?

the leds are connected from output pins 1-6

then i will buy and add the cap's.

So this is like saying, I will learn to drive first around my City but I will fix the breaks before I take the car on the interstate. Either is not an option.

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

very informative. when i order my next batch of componets ill make sure to get the caps

thanks for the help! 8)

in the mean time any help on the code?

tigerspittingfire:
the leds are connected from output pins 1-6

Which LED is connected to which output bit? Something like this?

0:
1: R1
2: G1
3: B1
4: R2
5: G2
6: B2
7:

It would have been easier if the LEDs were connected to outputs 0-2 and 4-6 of the shift registers.

0: R1
1: G1
2: B1
3:
4: R2
5: G2
6: B2
7:

this is a prototype once i master the code im gunna surface mount everything to minimize space.

It will be a lot easier to master the code if you write it yourself. I've given you a starting point. You fill the color array with color values for the 20 LEDs and send them all out. The lights will stay lit in that pattern until you send a different pattern.

If the LEDs are connected to different bits than what I assumed it's just a matter of adjusting the "color[register2]<<4 + color[register2+1]" to get each color value in the right place for your hardware.

can you explain to me why you would position the leds in that manner of output pins?

also im working on the code.

will update soon with screen shot thanks everyon for your help.

johnwasser:
So you have 10 shift registers daisy-chained together and 6 of the 8 outputs in each 8-bit shift register controls the three colors of two RGB LEDs.

byte color[20];  // Pattern of colors to display, three bits per color.

digitalWrite(latchPin, LOW);
for (int register = 0; register < 10; register++) {
    shiftOut(clockPin, dataPin, color[register2]<<4 + color[register2+1]);  // Send colors to two RGB LEDs
}
digitalWrite(latchPin,HIGH);





so this code goes in the void loop part right?

this is what i have so far....

im so nub! dont make fun hahahah

having some problems/errors

Your variable called 'register' is one of the words you can't use as it is used in the system. Replace it with 'myregister' or some other none reserved word.