Gamma correction on RGB LED’s (or something like that).

So today I’ve been working with some RGB LED’s once again and I’ve notice (or rather re noticed) how non-linear LED’s appear.

A bit of background: I’m working with 5050 type LED’s with ws2803/1 drivers, so each LED gets 8bit PWM for Red, Green and Blue LED’s. The problem is that when you drive the LED’s with signal, zero is off, and 255 is the brightest, but 128 is brighter than half brightness. So in fact the input data to the perceived output level appears to be┬ánon linear.

So I could just work out a mapping of input values to output values, but that’s not very smart is it… I could use some primitive squaring to obtain a kind of gamma correction, of I could use some Maths (yes Maths is Maths and not Math!). The only problem there is that my ability to create a complex but awesome function way surpasses the abilities of the Arduino I’m using to drive the LED’s. Might have to get creative on this one…

Anyway here’s some LED’s to keep everyone happy,