Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/Example2_SetOptions/Example2_SetOptions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ void setup()

//Pressure in Boulder, CO is 24.65inHg or 834.74mBar
airSensor.setAmbientPressure(835); //Current ambient pressure in mBar: 700 to 1200

float offset = airSensor.getTemperatureOffset(); //Get current temperature offset and save it in the variable "offset"

airSensor.setTemperatureOffset(5); //Set temperature offset to 5°C
}

void loop()
Expand All @@ -67,4 +71,3 @@ void loop()

delay(1000);
}

1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ beginMeasuring KEYWORD2
getCO2 KEYWORD2
getHumidity KEYWORD2
getTemperature KEYWORD2
getTemperatureOffset KEYWORD2
setMeasurementInterval KEYWORD2
setAmbientPressure KEYWORD2
setAltitudeCompensation KEYWORD2
Expand Down
7 changes: 7 additions & 0 deletions src/SparkFun_SCD30_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ void SCD30::setForcedRecalibrationFactor(uint16_t concentration)
sendCommand(COMMAND_SET_FORCED_RECALIBRATION_FACTOR, concentration);
}

//Get the temperature offset. See 1.3.8.
float SCD30::getTemperatureOffset()
{
uint16_t response = readRegister(COMMAND_SET_TEMPERATURE_OFFSET);
return (float) response / 100;
}

//Set the temperature offset. See 1.3.8.
void SCD30::setTemperatureOffset(float tempOffset)
{
Expand Down
1 change: 1 addition & 0 deletions src/SparkFun_SCD30_Arduino_Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class SCD30
uint16_t getCO2(void);
float getHumidity(void);
float getTemperature(void);
float getTemperatureOffset(void);

void setMeasurementInterval(uint16_t interval);
void setAmbientPressure(uint16_t pressure_mbar);
Expand Down