Stuck and not sure where to go

Hi guys and girls,
I don't do much with Arduino, probably one project every three or four years, I am currently working on driving RGB LED strips and using the PWM function to smoothly colour change them, so three outputs per strip, the problem I have is that I need to control 8 separate strips in sequence which means I need to use two mega 2560 together to get the required number of PWM out puts, my code although chunky works really nicely to control four strips, but I need a way to sync the second four strips.
the exhibit I am making requires the 8 strips to fade from one to other in a slow sequence slowly changing colour as they go.
I thought i would be able to start the first four strips and then send a pin high on the second mega to get it the start scrolling its strips, but I don't know how to make the second arduino wait so they are in sync
any ideas would be most welcome

Let's assume that you are going to take a pin on Mega #1 HIGH when the sequence starts and that you have connected that pin to pin 3 on Mega #2

Then in the Mega #2 code you do

while (digitalRead(3) == LOW)

The Mega #2 sketch will wait until pin 3 goes HIGH before moving on

Run much the same code on both Megas so they both think they are controlling eight strips. Then use UKHeliBob's suggestion to sync them up at the start.

In reality, each only runs four strips and the pins for the others are all set to a pin that is not used.

No it doesn’t. Using two processors to simply get more pins is very silly. You run into more problems than you solve that way.
What you do is to either fit port expander chips onto the SPI or I2C bus or a much better option is to fit some of these
To the I2C bus. You get 16 PWM signals for each chip and you can have 62 of these on a single i2c bus, a total of 992 outputs.

Oh my god, i was trying all sorts of stupid things like sending high low pins from one mega to the other, your right i should only need to sync the start - what a doughnut
i will give it a go now

thanks a million for seeing the wood amongst the trees

ok that works a treat for me, so thanks ukhelibob and wildbill,
grumpy_mike i agree different kit would have been better but where i work you get dumped with stuff at short notice and this project grew really fast, originally there were only 4 strips of smd5050 RGBW leds things change fast but the deadline doesnt so i had to go with what i had.

i can happily get on with watching the champions league final now

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.