Return scaled light value
This commit is contained in:
parent
121ab8f44e
commit
eed0c26237
1 changed files with 5 additions and 2 deletions
|
@ -115,10 +115,13 @@ int readLoudness()
|
|||
return analogRead(LOUDNESS_SENSOR);
|
||||
}
|
||||
|
||||
float readLight()
|
||||
int readLight()
|
||||
{
|
||||
int sensorValue = analogRead(LIGHT_SENSOR);
|
||||
return (float)(1023-sensorValue)*10/sensorValue;
|
||||
|
||||
return map(sensorValue, 1000, 200000, 1, 100);
|
||||
// return (float)(sensorValue)*10/sensorValue;
|
||||
// return (float)(1023-sensorValue)*10/sensorValue;
|
||||
// Not a great value
|
||||
// return analogRead(LIGHT_SENSOR) / 1000;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue