Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
9a6fa9e7
Commit
9a6fa9e7
authored
May 05, 2021
by
Eric Duminil
Browse files
calibrate! was broken
parent
a60fc29f
Pipeline
#3591
passed with stage
in 1 minute and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
9a6fa9e7
...
...
@@ -2,7 +2,7 @@
namespace
config
{
// UPPERCASE values should be defined in config.h
uint16_t
measurement_timestep
=
MEASUREMENT_TIMESTEP
;
// [s] Value between 2 and 1800 (range for SCD30 sensor).
uint16_t
measurement_timestep
=
MEASUREMENT_TIMESTEP
;
// [s] Value between 2 and 1800 (range for SCD30 sensor).
const
uint16_t
altitude_above_sea_level
=
ALTITUDE_ABOVE_SEA_LEVEL
;
// [m]
uint16_t
co2_calibration_level
=
ATMOSPHERIC_CO2_CONCENTRATION
;
// [ppm]
const
uint16_t
measurement_timestep_bootup
=
5
;
// [s] Measurement timestep during acclimatization.
...
...
@@ -201,7 +201,7 @@ namespace sensor {
Serial
.
print
(
F
(
"Setting SCD30 timestep to "
));
Serial
.
print
(
config
::
measurement_timestep
);
Serial
.
println
(
F
(
" s."
));
if
(
config
::
measurement_timestep
<
10
){
if
(
config
::
measurement_timestep
<
10
)
{
Serial
.
println
(
F
(
"WARNING: Timesteps shorter than 10s can lead to unreliable measurements!"
));
}
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep
);
// [s]
...
...
@@ -322,7 +322,12 @@ namespace sensor {
}
void
calibrateSensorRightNow
(
int32_t
calibrationLevel
)
{
stable_measurements
=
config
::
stable_measurements_before_calibration
;
calibrateSensorToSpecificPPM
(
calibrationLevel
);
if
(
calibrationLevel
>=
400
&&
calibrationLevel
<=
2000
)
{
Serial
.
print
(
F
(
"Force calibration, right now, at "
));
config
::
co2_calibration_level
=
calibrationLevel
;
Serial
.
print
(
config
::
co2_calibration_level
);
Serial
.
println
(
F
(
" ppm."
));
calibrateAndRestart
();
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment