MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / convertToLux

Method convertToLux

libraries/Max44009/max44009.cpp:190–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189
190float Max44009::convertToLux(uint8_t datahigh, uint8_t datalow)
191{
192 uint8_t exponent = datahigh >> 4;
193 uint32_t mantissa = ((datahigh & 0x0F) << 4) + (datalow & 0x0F);
194 float lux = ((0x0001 << exponent) * MAX44009_MIN_LUX) * mantissa;
195 return lux;
196}
197
198
199///////////////////////////////////////////////////////////

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36