RC Plane Light Show

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! :slight_smile: Thanks in advance!

It sounds like you need a state machine. Your input increments a state variable and the program carries out the actions for the current state. Switch/case is ideal for this. If you want to be able to change the state at any time, even in the middle of a sequence, use millis() instead of delay() for the timing.

Thank you! I'll give that a try!