Skip to content

Commit d4fc0d2

Browse files
rzrhobinjk
authored andcommitted
example: Fix range error in LevelSensor
Change-Id: I5fc44723c059d95d3dc3b8c640f19bcc3df69c30 Signed-off-by: Philippe Coval <[email protected]>
1 parent 57ce749 commit d4fc0d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/LevelSensor/LevelSensor.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void setup(void) {
5959
void loop(void) {
6060
const int threshold = 1;
6161
int value = analogRead(sensorPin);
62-
double percent = (double) 100. - (value/1204.*100.);
62+
double percent = (double) 100. - (value/1024.*100.);
6363
if (abs(percent - lastValue) >= threshold) {
6464
Serial.print("log: Value: ");
6565
Serial.print(value);

0 commit comments

Comments
 (0)