Controlling multiple values with one potentiometer

I want to control a RGB LED strip with one potentiometer and a button to change what I am controlling.
As you probably guess, I am pretty new to Arduino and I do not know how to program this.

So, if you did not understand the short-version of my project, here is a more detailed version of it:
Only one potentiometer, and one button to cycle the things I want to change.
The things I plan to do is: Change red color, green color, blue color, brightness.

I use a Arduino mega 2560 at the moment, but I am going to change it to an Arduino nano when that arrives. The led strip is a WS2812B, the library I use is FastLED and type NEOPIXEL.

Thanks :slight_smile:

I don't know anything about the LED stuff, but you could start experimenting with the button push control and pot logic just using a button, and a pot connected to the Arduino, and monitor what your code is doing via the serial monitor.

I would look at the example sketches that come with the IDE, then I would practice with one colour and the pot to dim using PWM.
Next I would set up a counter to count button presses with each number = a colour (1 is red 2 is blue 3 is green 4 is all off etc) however you want the button presses to work.
Then I would set up variables for each colour and write some code that says if count = x then pot value goes to x colour variable.

There are ways to make the button count reset to a "home" position after a preset amount of no activity if required.

This is accomplishable.

In your main loop, look for a button press.

During that button press, figure out what LED you are on and then read the analog pin into a variable, then write that variable to that LED.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

hawkmoon77:
During that button press

No not during, at all: on the press, that is the transition from low to high or high to low (depending on the wiring).

For switch buttons, use the "click" type tactile buttons or similar. They have less switch "bounce" that has to be accounted for.