Skip to content

Commit 8bf53a8

Browse files
committed
support optional autocalibration on begin.
1 parent f5c42c8 commit 8bf53a8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/SparkFun_SCD30_Arduino_Library.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SCD30::SCD30(void)
3333
}
3434

3535
//Initialize the Serial port
36-
bool SCD30::begin(TwoWire &wirePort)
36+
bool SCD30::begin(TwoWire &wirePort, bool autoCalibrate)
3737
{
3838
_i2cPort = &wirePort; //Grab which port the user wants us to use
3939

@@ -58,7 +58,7 @@ bool SCD30::begin(TwoWire &wirePort)
5858
if (beginMeasuring() == true) //Start continuous measurements
5959
{
6060
setMeasurementInterval(2); //2 seconds between measurements
61-
setAutoSelfCalibration(true); //Enable auto-self-calibration
61+
setAutoSelfCalibration(autoCalibrate); //Enable auto-self-calibration
6262

6363
return (true);
6464
}

src/SparkFun_SCD30_Arduino_Library.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ class SCD30
4949
{
5050
public:
5151
SCD30(void);
52-
53-
bool begin(TwoWire &wirePort = Wire); //By default use Wire port
52+
53+
bool begin(bool autoCalibrate) { return begin(Wire, autoCalibrate); }
54+
bool begin(TwoWire &wirePort = Wire, bool autoCalibrate=true); //By default use Wire port
5455

5556
bool beginMeasuring(uint16_t pressureOffset);
5657
bool beginMeasuring(void);

0 commit comments

Comments
 (0)