pimoroni / as7343-python

MIT License
0 stars 0 forks source link

Faulty readings #11

Open tony1tf opened 4 weeks ago

tony1tf commented 4 weeks ago

I've been running Python code with your library (from breakout_as7343 import BreakoutAS7343) to show the colour channels as bar graphs. However, 3 channels show low readings, which are not analogue. With low light level on channels 515nm, 600nm and 690nm, the output from the sensor is 11.0. With a higher light level the three channels jump to 139.0. Other working channels show readings in the 1000's. Is this a problem with your driver code, or do I have a faulty sensor?

Gadgetoid commented 1 week ago

I think I made a faulty assumption about the location of "ASTATUS" output in the FIFO, which has - as a consequence - shifted all the readings over by one position.

Because F1, F2 and FZ are the first readings from each result cycle they get replaced with the status data and each reading in turn gets replaced with its adjacent reading. I have no earthly clue how this wasn't completely and totally obvious to me when I wrote the two drivers.

In addition to this, result cycle 3 has been amended in the datasheet from "F1, F5, F7, F8, 2xVIS, FD" to "F1, F7, F8, F5, 2xVIS, FD", I've no idea when this happened because the datasheet neglects to clarify (for the record, it does say that these values were changed) but that would mean F5, F7 and F8 would be wrong even if I hadn't mucked up the status stuff.

AIUI now the FIFO output for each cycle is: Status, CH1, CH2, CH3, CH4, CH5, CH6, Flicker Detect.