Make brightness depend ~linearly on photocurrent

This commit is contained in:
fruchti 2020-07-15 22:47:55 +02:00
parent fe246bfa6d
commit 8c3a471aba
2 changed files with 2 additions and 2 deletions

View file

@ -1 +1 @@
277
280

View file

@ -66,7 +66,7 @@ void LightSensor_Poll(void)
{
unsigned int measurement = LightSensor_Measurement;
LightSensor_NewMeasurement = false;
float brightness = 1.0f - measurement / 65535.0f;
float brightness = 65535.0f / measurement;
LightSensor_AbsoluteBrightness = LIGHTSENSOR_LAMBDA * LightSensor_AbsoluteBrightness
+ (1.0f - LIGHTSENSOR_LAMBDA) * brightness;