21 #ifndef ADAFRUIT_SGP40_H 22 #define ADAFRUIT_SGP40_H 24 #include <Adafruit_BusIO_Register.h> 25 #include <Adafruit_I2CDevice.h> 29 #include "sensirion_arch_config.h" 30 #include "sensirion_voc_algorithm.h" 34 #define SGP40_I2CADDR_DEFAULT 0x59 37 #define SGP40_FEATURESET 0x0020 38 #define SGP40_CRC8_POLYNOMIAL 0x31 39 #define SGP40_CRC8_INIT 0xFF 40 #define SGP40_WORD_LEN 2 49 bool begin(TwoWire* theWire = &Wire);
54 uint16_t
measureRaw(
float temperature = 25,
float humidity = 50);
62 Adafruit_I2CDevice* i2c_dev = NULL;
63 void write(uint8_t address, uint8_t* data, uint8_t n);
64 void read(uint8_t address, uint8_t* data, uint8_t n);
65 bool readWordFromCommand(uint8_t command[], uint8_t commandLength,
66 uint16_t delayms, uint16_t* readdata = NULL,
68 uint8_t generateCRC(uint8_t data[], uint8_t datalen);
70 VocAlgorithmParams voc_algorithm_params;
72 #endif // ndef ADAFRUIT_SGP40_H bool softReset()
Commands the sensor to perform a soft reset using the "General Call" mode. Take note that this is not...
Definition: Adafruit_SGP40.cpp:84
bool heaterOff()
Request the sensor to turn off heater to lower curent consumption. Launching a measurement automatica...
Definition: Adafruit_SGP40.cpp:97
bool begin(TwoWire *theWire=&Wire)
Setups the hardware and detects a valid SGP40. Initializes I2C then reads the serialnumber and checks...
Definition: Adafruit_SGP40.cpp:47
uint16_t serialnumber[3]
Definition: Adafruit_SGP40.h:59
uint16_t measureRaw(float temperature=25, float humidity=50)
Return the raw gas measurement.
Definition: Adafruit_SGP40.cpp:147
Adafruit_SGP40()
Instantiates a new SGP40 class.
Definition: Adafruit_SGP40.cpp:37
int32_t measureVocIndex(float temperature=25, float humidity=50)
Combined the measured gasses, temperature, and humidity to calculate the VOC Index.
Definition: Adafruit_SGP40.cpp:132
bool selfTest(void)
Request the sensor to perform a self-test, returning the result.
Definition: Adafruit_SGP40.cpp:109
Class that stores state and functions for interacting with SGP40 Gas Sensor.
Definition: Adafruit_SGP40.h:46