Hi,
I was just wondering what equation do you use to calculate PWM to make the brightness look linear to a human eye while dimming?
I was searching through the web and found a lot of different equations.
I know the perception of brightness is exponentional.
I found this:
Round(((x^(10/input_limit)-1)/(x-1)) * output_limit)
which gives these values:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 27, 28, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47, 49, 52, 54, 56, 59, 61, 64, 66, 69, 72, 75, 78, 81, 84, 87, 91, 94, 98, 101, 105, 109, 113, 117, 121, 125, 130, 134, 139, 144, 149, 154, 159, 165, 170, 176, 182, 188, 194, 200, 207, 214, 221, 228, 235, 243, 250, 258, 267, 275, 284, 293, 302, 311, 321, 331, 342, 352, 363, 374, 386, 398, 410, 422, 435, 449, 462, 476, 491, 506, 521, 537, 553, 570, 587, 605, 623, 641, 661, 680, 701, 721, 743, 765, 788, 811, 835, 860, 885, 912, 939, 966, 995, 1023]
in practice I'm using x = value * value, which gives me 64 values of brightness if I have 12bit PWM driver (like TLC5940)
Anyone simplified the equation or came with something simple, better or faster?