16-Channel PWM and HSBColor.h

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
marco_it
 
Posts: 7
Joined: Wed Jul 29, 2015 9:11 am

16-Channel PWM and HSBColor.h

Post by marco_it »

Hi there,
I'm trying to control a set of RGBW leds with the 16CH pwm module. I need to control the color via HSB. The problem is that, for the 16CH pwm, the values domain is 0 to 4095 while from the HSB colour library I get values form 0 to 255 and the mapping to a bigger domains doesn't work really well since you do not get a even numbers distribution and then colour fade is not smooth. So I wonder if there is something that can be done form the side of the 16ch pwm module to make it more friendly to control LEDs. Is it possible to change the inputs domain?
Looking forward to hearing form you.
Best,
Marco

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: 16-Channel PWM and HSBColor.h

Post by adafruit_support_bill »

mapping to a bigger domains doesn't work really well since you do not get a even numbers distribution
It is an even multiple of 2^4. (shift left 4). That should be an even distribution.

The PWM resolution 16x your table resolution (12 bits vs 8 bots) so the device is capable of much finer resolution than your HSB table is capable of utilizing. To get smoother fades, you would need a higher resolution HSB table.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”