For my temperature/light chart I want to change how the light readings are displayed.
Currently 0 = full brightness and 1023 = darkness.
These are just the outputs of the LDR setup. I guess I would prefer if darkness was 1000 to somehow make it a bit easier but it isn't.
What I want to do is somehow invert it and convert into a percentage. So...
Full brightness = 100%
Darkness = 0%
I'll probably want to do this in PHP.
It feels like it shouldn't be too difficult but I currently can't get my head around what is probably some relatively simple maths.
|