Pages: [1]   Go Down
Author Topic: RC Plane Light Show  (Read 227 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley Thanks in advance!
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 90
Posts: 3512
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you! I'll give that a try!
Logged

Pages: [1]   Go Up
Jump to: