adafruit / Adafruit_CircuitPython_CCS811

circuit python driver for CCS811 air quality sensor
MIT License
34 stars 24 forks source link

How is `drive_mode` used and how to change it? #43

Closed janjagusch closed 3 years ago

janjagusch commented 3 years ago

Inside the constructor, self.drive_mode is set to DRIVE_MODE_1SEC (see here).

However, self.drive_mode is not called anywhere within the class. So I assume this attribute is just telling you the current drive mode but changing its value (e.g. by self.drive_mode = DRIVE_MODE_60SEC) won't change the behaviour of the sensor.

Am I right with my assumption? If so, having a method to set the drive mode (e.g. set_drive_mode) would be really useful!

janjagusch commented 3 years ago

Actually, it seems to be working correctly.

I adjusted the drive mode to DRIVE_MODE_10SEC and the measurement seems to update less frequently (see gist).

Quite a mystery to me how this is possible, but I'm glad it works as intended. :)

janjagusch commented 3 years ago

Ok, I take that back. Seems like it was a misinterpretation from my side and that the sensor does not respect drive_mode. Still investigating, will publish some updates soon.