7/23/22, 9:39 PM
Seeeduino XIAO Expansion board - Seeed Wiki
https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/
60/66
115
delay(
15
);
116
if
(memu ==
2
) {
117
memu =
0
;
118
}
119
}
120
Serial.println(memu);
121
122
if
(scd30.isAvailable() && memu ==
0
) {
123
scd30.getCarbonDioxideConcentration(result);
124
u8x8.setFont(u8x8_font_chroma48medium8_r);
125
u8x8.setCursor(
0
,
3
);
126
u8x8.print(
"CO2: "
);
127
u8x8.setCursor(
5
,
3
);
128
u8x8.print(result[
0
]);
129
u8x8.setCursor(
12
,
3
);
130
u8x8.print(
"pmm"
);
131
delay(
1000
);
132
}
133
134
if
(sensor.read_sensor_value(buf,
29
) && memu ==
0
) {
135
SERIAL_OUTPUT.println(
"HM330X read result failed!!!
136
}
137
if
(memu ==
0
){
138
parse_result(buf);
139
}
140
141
if
((millis() - starttime) > sampletime_ms && memu ==
142
ratio = lowpulseoccupancy / (sampletime_ms *
10.0
);
143
concentration =
1.1
*
pow
(ratio,
3
) -
3.8
*
pow
(rati
144
145
u8x8.setFont(u8x8_font_chroma48medium8_r);
146
u8x8.setCursor(
0
,
6
);
147
u8x8.print(
"Dust: "
);
148
149
u8x8.setCursor(
6
,
6
);
150
u8x8.print(concentration);
151
152
u8x8.setCursor(
12
,
6
);
153
u8x8.print(
"pcs"
);
154
155
// Serial.println(concentration);