MAX20361 Demo with LoRa Module on LP0 mode
Dependencies: SX1276GenericLib USBDevice
Fork of NonPingPong_PICO_LoRa_LP0 by
Diff: MAX44009/MAX44009_lib.cpp
- Revision:
- 5:9e751733a6f3
- Parent:
- 3:85fc843a9d7d
--- a/MAX44009/MAX44009_lib.cpp Mon Oct 12 21:56:39 2020 +0000 +++ b/MAX44009/MAX44009_lib.cpp Tue Oct 13 00:45:46 2020 +0000 @@ -137,3 +137,14 @@ return resp; } +double calc_lux(char *data) { + + // data is an array of size 2 + + int exponent = int(data[0] >> 4); + int mantissa = (int)((data[0] << 4) & 0xF0) + (int)(data[1]); + double lux = 0.045 * mantissa * pow((double) 2, exponent); + + return lux; + +} \ No newline at end of file