Question about gain on sensor

I'm getting counts of about 1 or 2

Thanks, that verifies my suspicion about the Adafruit code. The NaNs definitely result from division by zero, which any amateur should know how to avoid.

On the other hand, the statistics are TERRIBLE for such low counts. Recall that the error in counting statistics is +/- sqrt(N), so a count of 1 or 2 is not significantly different from zero.

The NaNs definitely result from division by zero, which any amateur should know how to avoid.

It's a known issue, they just haven't done anything about it. From the thread I posted in the Adafruit forums, a support person replied to my post about noise and nan's:

The NaN errors come from the lux calculation. If the Channel 0 value reads zero, the equation will do a divide by zero and result in a NaN.

At least I can see from the counts when and why those sort of NaN errors occur.

On the other hand, the statistics are TERRIBLE for such low counts. Recall that the error in counting statistics is +/- sqrt(N), so a count of 1 or 2 is not significantly different from zero.

Yeah, I agree I can't rely on anything that low, the longer I leave the acquisition the better it looks.