You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Could you add a gamma correction for LED brightness?
It can be learned from "LED.cpp - Library for LEDs. Created by Benjamin Wüst" which I cannot find anymore on github (have a local copy though).
int LED::calculate_linear_fade_position_to_exponential(int position, double pwm_max_steps, double gamma_correction)
{
// This function needs scientific backup!
// http://www.wolframalpha.com/input/?i=plot+y%3Dround%28255*%28x%2F255%29^%282.2%29%29+from+x%3D0+to+255
int out = round(pwm_max_steps * ( pow( (position/ 255.0) , gamma_correction) ));
return out;
}
Gamma of 2.2 seems to be good. BTW, why isn't the bool activeLow = false not working with fade?
Cool library nevertheless! Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
Could you add a gamma correction for LED brightness?
It can be learned from "LED.cpp - Library for LEDs. Created by Benjamin Wüst" which I cannot find anymore on github (have a local copy though).
Gamma of 2.2 seems to be good. BTW, why isn't the bool activeLow = false not working with fade?
Cool library nevertheless! Thanks!
The text was updated successfully, but these errors were encountered: