Skip to content

Commit 261cb06

Browse files
committed
fix(example): Update Illuminance example
1 parent b22d447 commit 261cb06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/Zigbee/examples/Zigbee_Illuminance_Sensor/Zigbee_Illuminance_Sensor.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
// conversion into zigbee raw illuminance value (typically between 0 in darkness and 50000 in direct sunlight)
4949
// depends on the value range of the raw analog sensor values and will need calibration for correct lux values
50-
int lsens_illuminance_raw = lsens_analog_raw * 10; // multiply by 10 for the sake of this example
50+
int lsens_illuminance_raw = map(lsens_analog_raw, 0, 4095, 0, 50000); // to demonstate map the 12-bit ADC value (0-4095) to Zigbee illuminance range (0-50000)
5151
Serial.printf("[Illuminance Sensor] raw illuminance value: %d\r\n", lsens_illuminance_raw);
5252

5353
// according to zigbee documentation the formular 10^(lsens_illuminance_raw/10000)-1 can be used to calculate lux value from raw illuminance value
@@ -134,7 +134,7 @@
134134
}
135135
}
136136
// force report of illuminance when button is pressed
137-
zbIlluminanceSensor.reportIlluminance();
137+
zbIlluminanceSensor.report();
138138
}
139139
delay(100);
140140
}

0 commit comments

Comments
 (0)