Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Zigbee_Illuminance_Sensor.ino
  • Loading branch information
P-R-O-C-H-Y committed Mar 26, 2025
commit b80ad66c62c7d56201bf06c7b0e628a971e8ec3a
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ static void illuminance_sensor_value_update(void *arg) {

// conversion into zigbee raw illuminance value (typically between 0 in darkness and 50000 in direct sunlight)
// depends on the value range of the raw analog sensor values and will need calibration for correct lux values
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)
// for demonstration purpose map the 12-bit ADC value (0-4095) to Zigbee illuminance range (0-50000)
int lsens_illuminance_raw = map(lsens_analog_raw, 0, 4095, 0, 50000);
Serial.printf("[Illuminance Sensor] raw illuminance value: %d\r\n", lsens_illuminance_raw);

// according to zigbee documentation the formular 10^(lsens_illuminance_raw/10000)-1 can be used to calculate lux value from raw illuminance value
Expand Down
Loading