OPT3001 conversion formula / equation?
On page 20 of the datasheet the detailed description of the calculation is given. From the given example value from the comments 0x5461 we are getting the 0x5 for the exponent value, which is corresponding to 0.32 lux per LSB. The mantissa is 0x461 or 1121 in decimal. The resulting value is 1121*0.32=358.72lux which is close to the expected range.

The working conversion code:

#include &lt;stdio.h&gt;
#include &lt;stdint.h&gt;

int main(void) {
    uint16_t raw = 0x5461;
    uint16_t result, exponent;
    float lux;

    result = raw &amp; 0x0FFF;
    exponent = (raw&gt;&gt;12) &amp; 0x000F;

    lux=0.01*(1&lt;&lt;exponent)*result;

    printf("%f\n", lux);
    return 0;
}


Or run it here.

Please pay a close attention to the datatypes used, they might have causing trouble to you as well..