Open leinardi opened 6 years ago
This behavior is exactly the reason I wrote this fork of contrib-driver. Usually, I don't instance these drivers directly but with *UserDriver class. I'll test and research what is going on, I suspect first value released is read faster than buri in time of the hardware itself.
For my specific use case I need only one reading of all 3 values every 5 min, so the sensor manager seems too complex and wasteful of resources (I would need 3 separate DynamicSensorCallback()
that are going to poll several time per seconds each), when, accessing directly the sensor, I should be able to do only the reads I really need.
If the problem is only the first read, maybe you can call a readAll()
at the end of the connect()
, so that the wrong readings are discarded. This is a workaround, not a fix, but should work until is properly fixed.
For the very first reading I'm getting values of humidity and pressure very different from the successive readings.
For example, with this code:
I'm getting this output:
Is this behavior intended? Should I manually do multiple readings and discard the firsts?