adafruit / Adafruit_CCS811

Arduino driver for CCS811 digital gas sensor
MIT License
65 stars 36 forks source link

Add support for RAW_DATA content within readData() #22

Closed chbw closed 3 years ago

chbw commented 3 years ago

The CCS811 also reports RAW_DATA and the corresponding data has already been read by readData(). The code in this pull request parses the sensor data and stores the "Current Selected" and "Raw ADC reading" for later retrieval.

Having the raw ADC reading (and sense current) available helps in judging whether or not the sensor has stabilized/the conditioning period can be considered complete and it is safe to save the baseline register. See Application Note AN000370 for details on why you should save and restore the baseline register and when to do so. Please note that code for reading and writing the baseline register is not part of this pull request.

ladyada commented 3 years ago

thanks - please clangformat :) https://learn.adafruit.com/contribute-to-arduino-with-git-and-github/testing-with-github-actions