Pages: [1]   Go Down
Author Topic: Analog RGB Strip color picker and more  (Read 1302 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, so I am starting a new project that will eventually get installed in my car. What I hope to have once it is all done;
an arduino that controls a 5050 analog RGB led strip with the following options;
THE FOLLOWING HAS CHANGED, SEE POST #4
0) on\off button
1) a potentiometer (or digital encoder if needed) that when turned will control the color of the LEDS (one potentiometer though, not 3)
2) push a button and turn on/off leds change brightness based off of sound (color of LEDS stays constant to that picked from #1)
3) push a button and turn on/off leds change brightness AND COLOR based off of sound


I know next to nothing when it comes to arduino programming so this should be interested and I will really be relying on you guys a lot. I so far have my LED strip setup based off of this tutorial and have gotten the example code to work perfectly to fade the colors.
http://learn.adafruit.com/rgb-led-strips/usage

So now my next question is, how can i use a single potentiometer to pick the color of the LED strip, I have seen it done using 3 one for each color but I would love to do it with just one.

I will do this step by step and then I assume, combine all those steps into one final sketch that will execute what I laid out above. Any help is greatly appreciated guys.
« Last Edit: September 23, 2013, 08:22:58 am by mdifilippo » Logged

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

Just found this!
http://www.arduino.cc/en/Tutorial/LEDCross-fadesWithPotentiometer
Awesome, so I have some pretty nice control of the color now but I have no white (or r,g,b all at 255) is there anyway to add this in to the code? Also anyway to get MORE gradieting ? 
Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 80
Posts: 3225
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Personally, I would avoid potentiometers as far as possible.  You will note that modern equipment no longer uses them by and large as they tend to have problems with reliability and wear and tear (and in particular, noise when used as a volume control).

Not that that would be a major problem in your application, but rotary encoders are far more effective in digital systems.  For one thing, they provide digital inputs to what is after all, a digital system (though you do have to arrange de-bouncing).

They are available quite cheap (on eBay of course) and those have a push switch incorporated, usually to provide menu traversal and selection.  In your situation, this could be used for mode selection so that successive presses switch between chroma selection, saturation selection, and brightness.  You might need an extra (RGB?) LED to indicate which mode is current if you are using no other display (but you may wish to complicate matters later, and want a LCD display.

In the case of the chroma mode, continuous rotation (in either direction) can repeatedly cycle through different colours in sequence, but if you wish finer resolution, you can require more than one turn for a complete cycle (as you could do also for each of the other two modes).  So unlike the potentiometer, a rotary encoder facilitates as fine a detail as you ever want.
Logged

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

Thanks Paul, I am totally open to use an encoder instead, I wasn't sure which would be the better option. I could see a pushbutton encoder simplifying the setup greatly by using it instead of the individual buttons.
Logged

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

So now with using a digital encoder here is the new roadmap I made up.

Press the encoder in once: turn system on, last picked color appears
Turn digital encoder to pick color
Push the encoder again: goes into sound activation mode via an onboard electret mic. The color of the LEDs is that picked from previous selection
Turning the digital encoder at this point would change the color
Push the encoder once again; goes into sound activation mode via onboard electret mic where the color changes as it goes with the music
Turning the digital encoder at this point would do nothing
Push the encoder the last time and the system turns off

I want one encoder to pick the color with, at one end of the encoder I want red, and on the opposite pure white (or all LEDS on).

So with all this in mind where do I get started? The code for the encoder to pick color I believe I have found, but what I am struggling to locate is the second option, to have the sound activate control just ONE color. Any help with code is hugely appreciated
Logged

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

Any help with the code?
Logged

Pages: [1]   Go Up
Jump to: