|
6 | 6 | #include <Wire.h>
|
7 | 7 |
|
8 | 8 | // the i2c address
|
9 |
| -#define SCD30_I2CADDR_DEFAULT 0x61 ///< SGP30 has only one I2C address |
| 9 | +#define SCD30_I2CADDR_DEFAULT 0x61 ///< SCD30 has only one I2C address |
10 | 10 |
|
11 | 11 | // commands and constants
|
12 |
| -#define SCD30_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP30's CRC polynomial |
| 12 | +#define SCD30_CRC8_POLYNOMIAL 0x31 ///< Seed for Scd30's CRC polynomial |
13 | 13 | #define SCD30_CRC8_INIT 0xFF ///< Init value for CRC
|
14 | 14 | #define SCD30_WORD_LEN 2 ///< 2 bytes per word
|
15 | 15 |
|
16 |
| -/**************************************************************************/ |
17 |
| -/*! Class that stores state and functions for interacting with SGP30 Gas Sensor */ |
18 |
| -/**************************************************************************/ |
| 16 | +/** |
| 17 | + * |
| 18 | + * |
| 19 | + * |
| 20 | + * |
| 21 | + * |
| 22 | + * |
| 23 | + * */ |
19 | 24 | class SCD30 {
|
20 | 25 | public:
|
21 | 26 | SCD30();
|
22 | 27 | boolean begin(TwoWire *theWire = NULL);
|
23 | 28 | float fTemp, fRH, fCO2;
|
24 | 29 | boolean bReady;
|
25 | 30 |
|
26 |
| - boolean trigSingleMeasurement(uint16_t ambientPressure); |
27 |
| - boolean trigContinuousMeasurement(uint16_t ambientPressure); |
| 31 | + boolean trigSingleMeasurement(uint16_t ambientPressure = 0); |
| 32 | + boolean trigContinuousMeasurement(uint16_t ambientPressure = 0); |
28 | 33 | boolean stopContinuousMeasurement();
|
29 |
| - boolean setMeasurementInterval(uint16_t uInterval); |
| 34 | + boolean setMeasurementInterval(uint16_t uInterval = 2); |
30 | 35 | boolean getDataReadyStatus();
|
31 | 36 | boolean readMeasurement();
|
32 | 37 | boolean setTemperatureOffset(uint16_t tempOffset);
|
33 | 38 | boolean setAltitudeOffset(uint16_t altitude);
|
34 | 39 |
|
35 |
| - boolean setASC(boolean enable); |
| 40 | + boolean setASC(boolean enable = true); |
36 | 41 | boolean setFRCValue(uint16_t co2baseline);
|
37 | 42 |
|
38 | 43 | private:
|
|
0 commit comments