light sensor

fixed range - now 0 to 100
This commit is contained in:
shadow00 2016-09-17 10:17:35 +02:00 committed by GitHub
parent 6eff36979d
commit a024adadd0

View file

@ -127,10 +127,10 @@ int readLoudness()
int readLight()
{
int sensorValue = analogRead(LIGHT_SENSOR);
//return sensorValue;
return sensorValue;
return map(sensorValue, 1000, 200000, 1, 100);
return map(sensorValue, 11, 27333, 0, 413);
// return (float)(sensorValue)*10/sensorValue;
// return (float)(1023-sensorValue)*10/sensorValue;
// Not a great value