*linear* PWM LED fade with arduino Answered
Arduino comes with a simple program to make an LED fade on or off, however, as far as I can tell, the apparent brightness of the LED does not change linearly with the wpm duty cycle. After some research I found that this is because humans percieve brightness logarithmicly, not linearly. (Also, LEDs don't change brightness linearly with current, but sisnce I'm using PWM, i don't think that comes in to effect.)
I found a simple look-up table to correct for this on this page.
255, 180, 128, 90, 64, 45, 32, 23, 16, 12, 8, 6, 4, 3, 2, 1,0
This seems to work very well, but I don't know where this comes from. Does anyong know the ectual equation to get the % duty cycle from the %brightness? I like to abstractise things.