Pages: [1]   Go Down
Author Topic: Multi function LED controller  (Read 1815 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am fairly new at Arduino programming and would like to make a controller the will have 3 effects options.
I have built similar controllers already and use it for a single effect, but would like to incorporate all 3 using a selector switch to choose the effect to run.
The effects are fairly basic, 1- flicker (flame flicker) 2 - Random fade up and down (erratic power) 3 - Strobe.
The controller has a 3 position switch for program selection and 2 pots to vary each effect. The pots will adjust the flicker rate and brightness in mode 1, The frequency of the power disturbance in mode 2 and the on time and off time in mode 3.
I am using the Arduino Pro, the outputs are on the 6 PWM outputs, the pots or on analog inputs 0 and 1 with the selector switch input on 0,1 and 2. The PWM outs are triggering FETs to power the LEDs.
As I said I can run the program as a single effect controller but do not know the best way to combine all three programs together.
Any help would be greatly appreciated.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 614
Posts: 49358
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
As I said I can run the program as a single effect controller but do not know the best way to combine all three programs together.
Any help would be greatly appreciated.
You could randomly copy bits and pieces from one sketch to another in the hopes that stuff worked. Or, you could post the 3 sketches that work, and we can help you merge them.

Are you able to read the switch to choose the code to run?
Logged

Offline Offline
God Member
*****
Karma: 3
Posts: 716
a, b = b, a+b
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

isnt it just a case of

"if input 1 HIGH then effect 1,
if input 2 HIGH then effect 2
if input 3 HIGH then effect3"?

or am i missing something?
Logged


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

Thanks for the suggestions. I was using the If then to check the switch but my switch was not working properly.
I have it working now.
Logged

Pages: [1]   Go Up
Jump to: