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
79f137e8
Commit
79f137e8
authored
Apr 30, 2021
by
Eric Duminil
Browse files
co2_sensor: Add F-Strings
parent
0721221d
Pipeline
#3352
passed with stage
in 1 minute and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
79f137e8
...
...
@@ -84,13 +84,13 @@ namespace sensor {
Serial
.
print
(
F
(
"Setting temperature offset to -"
));
Serial
.
print
(
abs
(
config
::
temperature_offset
));
Serial
.
println
(
" K."
);
Serial
.
println
(
F
(
" K."
)
)
;
scd30
.
setTemperatureOffset
(
abs
(
config
::
temperature_offset
));
// setTemperatureOffset only accepts positive numbers, but shifts the temperature down.
delay
(
100
);
Serial
.
print
(
F
(
"Temperature offset is : -"
));
Serial
.
print
(
scd30
.
getTemperatureOffset
());
Serial
.
println
(
" K"
);
Serial
.
println
(
F
(
" K"
)
)
;
Serial
.
print
(
F
(
"Auto-calibration is "
));
Serial
.
println
(
config
::
auto_calibrate_sensor
?
"ON."
:
"OFF."
);
...
...
@@ -100,7 +100,7 @@ namespace sensor {
Serial
.
println
();
Serial
.
print
(
F
(
"Setting SCD30 timestep to "
));
Serial
.
print
(
config
::
measurement_timestep_bootup
);
Serial
.
println
(
" s during acclimatization."
);
Serial
.
println
(
F
(
" s during acclimatization."
)
)
;
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep_bootup
);
// [s]
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
" 1500 (Sets co2 level, for debugging purposes)"
));
...
...
@@ -120,7 +120,7 @@ namespace sensor {
int32_t
now
=
millis
();
Serial
.
print
(
F
(
"Measurement time offset : "
));
Serial
.
print
(
now
-
previous_measurement_at
-
config
::
measurement_timestep
*
1000
);
Serial
.
println
(
" ms."
);
Serial
.
println
(
F
(
" ms."
)
)
;
previous_measurement_at
=
now
;
}
...
...
@@ -189,7 +189,7 @@ namespace sensor {
if
(
config
::
debug_sensor_states
)
{
Serial
.
print
(
F
(
"Changing sensor state: "
));
Serial
.
print
(
state_names
[
current_state
]);
Serial
.
print
(
" -> "
);
Serial
.
print
(
F
(
" -> "
)
)
;
Serial
.
println
(
state_names
[
new_state
]);
}
current_state
=
new_state
;
...
...
@@ -204,7 +204,7 @@ namespace sensor {
Serial
.
println
(
F
(
"Sensor acclimatization finished."
));
Serial
.
print
(
F
(
"Setting SCD30 timestep to "
));
Serial
.
print
(
config
::
measurement_timestep
);
Serial
.
println
(
" s."
);
Serial
.
println
(
F
(
" s."
)
)
;
scd30
.
setMeasurementInterval
(
config
::
measurement_timestep
);
// [s]
}
if
((
current_state
==
PREPARE_CALIBRATION_UNSTABLE
)
||
(
current_state
==
PREPARE_CALIBRATION_STABLE
))
{
...
...
@@ -306,7 +306,7 @@ namespace sensor {
if
(
timestep
>=
2
&&
timestep
<=
1800
)
{
Serial
.
print
(
F
(
"Setting Measurement Interval to : "
));
Serial
.
print
(
timestep
);
Serial
.
println
(
"s."
);
Serial
.
println
(
F
(
"s."
)
)
;
sensor
::
scd30
.
setMeasurementInterval
(
timestep
);
config
::
measurement_timestep
=
timestep
;
led_effects
::
showKITTWheel
(
color
::
green
,
1
);
...
...
@@ -318,7 +318,7 @@ namespace sensor {
Serial
.
print
(
F
(
"Force calibration, at "
));
config
::
co2_calibration_level
=
calibrationLevel
;
Serial
.
print
(
config
::
co2_calibration_level
);
Serial
.
println
(
" ppm."
);
Serial
.
println
(
F
(
" ppm."
)
)
;
sensor
::
startCalibrationProcess
();
}
}
...
...
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