Hey everyone! I am working a accent lighting strip to mount over the top

Hey everyone! I am working a accent lighting strip to mount over the top of my kitchen sink under the cabinets, and I’m having a bit of trouble with getting it to work. I’m using FastLED3.1 and a Arduino nano. here is the pastebin:
http://pastebin.com/9Mb35ZHi
What I want to accomplish is two different color groups. each with there own Pot to control hue and their own pot to control brightness. Four potentiometers total. I’m getting odd things when I turn the pots. some pots are controlling hue, some are doing both hue and brightness. It may be a wiring issue, but being new to Arduino and C++ language, I’m also unsure about the code. Can anyone take a look and see if they see anything wrong with my code before I go to rewire the whole controller. Thanks in advance!!

Not an expert, but the code looks pretty reasonable. Am wondering about the wiring and power. Also, ‘accent lighting’ strip? Is it not a 5V WS2812 strip?

Yes, they are WS2812B’s. I had them running on a SP103 cheap RF plug and play controller. so power should be good. I wired the pots pretty much in series except the middle pin on each goes to the Arduino. I’m now thinking they should be wired in parallel so they don’t interfere with the voltages down the line.

You use the following 2 lines in your code…
FastLED.setBrightness(brightnessa); FastLED.setBrightness(brightnessb);
FastLED.setBrightness is a global brightness setting and the first line is useless as the value of brightnessa is lost and overwritten by brightnessb.

So what can I do to set them each differently. I assumed that it was setting the brightness for the given intiger “brightnessa, and brightnessb.”

Yes, I’d remove the two lines that JP Roy mentioned because you’d already assigned brightness in your for loops.

Yea, that worked guys. Thanks a bunch. My next step was to rewire the controller. Glad I asked for a second (or third) set of eyes first.

it also seems your groups are overlapping? you start with both of them at i=0:

I guess

for (int i = 0; i < NUM_COLORB; i++)

should be replaced with

for (int i = NUM_COLORA; i < NUM_COLORA+NUM_COLORB; i++)

@Evan_Bruno Not sure what you mean by: “I wired the pots pretty much in series”
Each pot should be wired separately with GND and +5Vdc on the 2 outside terminals and the middle terminal is wired to your analog input pin. That is the typical pot pin assignment.

Hi @Sebastian_Stuecker , sorry but I think Evans code is OK there !
He is going through the list of pixel numbers in the order specified in his definitions of:
uint8_t colora[NUM_COLORA]
uint8_t colorb[NUM_COLORB]
However, I find that he assigned 110 as a pixel number in colora[NUM_COLORA] !?
109 is the last pixel number 0 --> 109
A bit surprised it compiled as he specifies 1 more data entry than the array size !?

Yea JP, I noticed that and corrected it. it compiled if I have less pixels than defined. But not if I had a single pixel more. And the way I wired the pots was a single positive wire connecting to all 4 pots, and a single negative wire connecting all the pots. Then the center pin(s) go back to the Arduino.
O------O-------O--------O---------------- +
O-~ O-~ O-~ O-~
O------O--------O-------O---------------- NEGATIVE

HAHA actually I just repasted the pastebin. It doesn’t compile. I thought I had fixed that before I posted.

So, what happened after you pulled out those two ‘setBrightness’ lines?

Also, we haven’t seen any information on the power except a vague reference to ‘SP103 RF Controller’.

@Evan_Bruno The wiring for your pots is OK !
Now I understand what u meant by ‘in series’ :wink:

It worked as the code told it to. its when I realized a few pixel indexing mistakes. but it was what was needed to get it up and running.

I have a 5V 10A supply that I connected directly to the strip. and ran another positive wire down the strip touching the 5V pads every 30leds. then I have another leg of the supply powering one of these:

that supplies the Arduino with 12V and also a second analog warm white Led strip that runs the entire length of the WS2812B’s. I didn’t want to waste the hours on my digital RGB’s to try to find a equivalent color to warm white. this was easier to code as well.

Well, this is nicely powered, and from the sounds of your previous statement, you’re on your way. GL!

yeah sorry for my wrong direction, i did not realize its 2 different arrays.