Skip to content

Commit 80a5852

Browse files
committed
Adding function to set forced recal factor
1 parent 37fa793 commit 80a5852

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/SparkFun_SCD30_Arduino_Library.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ void SCD30::setAutoSelfCalibration(boolean enable)
115115
sendCommand(COMMAND_AUTOMATIC_SELF_CALIBRATION, 0); //Deactivate continuous ASC
116116
}
117117

118+
//Set the forced recalibration factor. See 1.3.7.
119+
//The reference CO2 concentration has to be within the range 400 ppm ≤ cref(CO2) ≤ 2000 ppm.
120+
void SCD30::setForcedRecalibrationFactor(uint16_t concentration)
121+
{
122+
if(concentration < 400 || concentration > 2000) return; //Error check.
123+
sendCommand(COMMAND_SET_FORCED_RECALIBRATION_FACTOR, concentration);
124+
}
125+
118126
//Set the temperature offset. See 1.3.8.
119127
void SCD30::setTemperatureOffset(float tempOffset)
120128
{

src/SparkFun_SCD30_Arduino_Library.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class SCD30
6767
void setAmbientPressure(uint16_t pressure_mbar);
6868
void setAltitudeCompensation(uint16_t altitude);
6969
void setAutoSelfCalibration(boolean enable);
70+
void setForcedRecalibrationFactor(uint16_t concentration);
7071
void setTemperatureOffset(float tempOffset);
7172

7273
boolean dataAvailable();

0 commit comments

Comments
 (0)