File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
SCD4x_I2C_FRC_Forced_Recalibration_Example
SCD4x_I2C_minimal_example Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 31
31
32
32
#include < Wire.h>
33
33
34
- // SCD40
34
+ // SCD4x
35
35
const int16_t SCD_ADDRESS = 0x62 ;
36
36
37
37
void setup () {
@@ -52,7 +52,7 @@ void setup() {
52
52
// wait until sensors are ready, > 1000 ms according to datasheet
53
53
delay (1000 );
54
54
55
- // start scd measurement in periodic mode, will update every 2 s
55
+ // start scd measurement in periodic mode, will update every 5 s
56
56
Wire.beginTransmission (SCD_ADDRESS);
57
57
Wire.write (0x21 );
58
58
Wire.write (0xb1 );
@@ -108,7 +108,7 @@ void setup() {
108
108
// wait for sensor
109
109
delay (20 );
110
110
111
- // assuming an external reference shows 350 ppm
111
+ // assuming an external reference shows 650 ppm
112
112
calibration = 650 ;
113
113
114
114
// prepare buffer with data for calibration
@@ -155,8 +155,8 @@ void setup() {
155
155
Wire.write (0xb1 );
156
156
Wire.endTransmission ();
157
157
158
- // wait for first measurement to be finished
159
- delay (4000 );
158
+ // wait for first measurement to be finished (> 5 s)
159
+ delay (10000 );
160
160
}
161
161
162
162
void loop () {
@@ -194,8 +194,8 @@ void loop() {
194
194
Serial.print (humidity);
195
195
Serial.println ();
196
196
197
- // wait 2 s for next measurement
198
- delay (2000 );
197
+ // wait 5 s for next measurement
198
+ delay (5000 );
199
199
}
200
200
201
201
// calculate CRC according to datasheet section 5.17
Original file line number Diff line number Diff line change 31
31
32
32
#include < Wire.h>
33
33
34
- // SCD40
34
+ // SCD4x
35
35
const int16_t SCD_ADDRESS = 0x62 ;
36
36
37
37
void setup () {
38
+ // check in your settings that the right speed is selected
38
39
Serial.begin (115200 );
39
40
// wait for serial connection from PC
40
41
// comment the following line if you'd like the output
@@ -50,14 +51,14 @@ void setup() {
50
51
// wait until sensors are ready, > 1000 ms according to datasheet
51
52
delay (1000 );
52
53
53
- // start scd measurement in periodic mode, will update every 2 s
54
+ // start scd measurement in periodic mode, will update every 5 s
54
55
Wire.beginTransmission (SCD_ADDRESS);
55
56
Wire.write (0x21 );
56
57
Wire.write (0xb1 );
57
58
Wire.endTransmission ();
58
59
59
60
// wait for first measurement to be finished
60
- delay (2000 );
61
+ delay (5000 );
61
62
}
62
63
63
64
void loop () {
@@ -96,5 +97,5 @@ void loop() {
96
97
Serial.println ();
97
98
98
99
// wait 2 s for next measurement
99
- delay (2000 );
100
+ delay (5000 );
100
101
}
You can’t perform that action at this time.
0 commit comments