timmygoffin

So, I have a large scale RC plane wrapped with over 60 feet of LED tape. Darn thing is so bright, it looks like the sun in the night sky, haha. I've wired the LEDs in 6 gorups to a few logic level MOSFETS and I'm controlling them with an on board ardweeny. To change the light pattern, I have a single input from my receiver. Using digitalRead, I can use the change in duty cycle of that channel when I flip a switch on my remote and turn on the LEDs or change their pattern. But I have bigger plans for a system with this much potential. What I would like to do is program several sequences (or loops) and use the switch as a sort of "GO" button to continue to the next sequence. This way, I can program the LEDs to a song and use the switch to keep the music and the lights in sync. If anybody has an idea on how to go about doing this, it would be great if you could share it! Thanks in advance!

Use a variable and keep track of which state you are in.Then use switch:case to select between state and the sequence you are running.Have each case monitor the Go button, and break out of the sequence so the next one can start.