Skip to content

Commit bbd90c1

Browse files
authored
Merge pull request Sensirion#6 from Sensirion/improve-scd4x-example
improve scd frc example
2 parents 5f200b2 + 01a9a95 commit bbd90c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

SCD4x_I2C_FRC_Forced_Recalibration_Example/SCD4x_I2C_FRC_Forced_Recalibration_Example.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ void setup() {
5858
Wire.write(0xb1);
5959
Wire.endTransmission();
6060

61-
// wait for first measurement to be finished
62-
delay(2000);
61+
// wait for 5 minutes to equilibrate sensor to ambient
62+
Serial.println("# Waiting 5 minutes for equilibration");
63+
delay(5 * 60 * 1000);
6364

64-
Serial.println("# CO2 values before recalibration");
65+
Serial.println("# CO2 values before calibration");
6566

6667
// measure 5 times
6768
for(repetition = 0; repetition < 5; repetition++) {
@@ -93,10 +94,7 @@ void setup() {
9394

9495
delay(2000);
9596
}
96-
97-
// wait for another 5 minutes to equilibrate sensor to ambient
98-
Serial.println("# Waiting 5 minutes for equilibration");
99-
//delay(5 * 60 * 1000);
97+
10098

10199
// stop scd measurement
102100
Wire.beginTransmission(SCD_ADDRESS);
@@ -110,6 +108,8 @@ void setup() {
110108

111109
// assuming an external reference shows 650 ppm
112110
calibration = 650;
111+
Serial.print("# Calibrating with reference value [ppm]: ");
112+
Serial.println(calibration);
113113

114114
// prepare buffer with data for calibration
115115
// calculate CRC for each 2 bytes of data

0 commit comments

Comments
 (0)