Arduino RGB LED Color Picker/Gradient

Hi All,

I recently posted the code to my latest Arduino project. This is a interactive color gradient that allows you to control the color of your RGB LED, via the Arduino. You can find a description of the application and related code on my blog


I got this working with the TLC5940 (yay!), but because the picker only sends values up to 255 the brightness of my LED array is very low. Is it possible to get this solution to have the max values be 4095? If not, is there a similar solution that will?

I checked the javadoc for the color picker and it seems to not allow for picking anything but 9 bit values.

Couldn't you just multiple the values by 16 in the sketch to scale to 12-bit? You wouldn't need to mess with the Java code or the communication.


Yes, I did try this in the obvious places (to me) but it didn't work. Here's the modified Java code from the project.

Note line 96 and 191-193

Despite the multiplication the brightness remains the same.

Thanks for any help!

You have the right idea but you should be doing the scaling in the Arduino sketch, not the Java code.

ok i am trying this thing out and it is not working my com port is COM4 and i cann not figure out how in the heck i am supposed to make this work.. i have the code uploaded to my arduino but thats as far as i can figure out

I did something similar using Processing to control the PWM on the arduino board to mix 3 LEDs or an RGB LED

Processing controlling Arduino LEDs

which covers sending data over the serial port. Hope that helps out a bit.

Any questions let me know,