Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
096c204a
Commit
096c204a
authored
Jun 23, 2022
by
Eric Duminil
Browse files
Hard coded 400ppm for S8 :-/
parent
ba12d7f6
Pipeline
#6595
passed with stage
in 2 minutes and 5 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
ampel-firmware/co2_sensor.cpp
View file @
096c204a
...
...
@@ -68,8 +68,7 @@ namespace sensor {
state
current_state
=
BOOTUP
;
void
switchState
(
state
);
void
setCO2forDebugging
(
int32_t
fakeCo2
);
void
calibrateSensorToSpecificPPM
(
int32_t
calibrationLevel
);
void
calibrateSensorRightNow
(
int32_t
calibrationLevel
);
void
calibrateSensorRightNow
();
void
setAutoCalibration
(
int32_t
autoCalibration
);
void
setTimer
(
int32_t
timestep
);
...
...
@@ -107,11 +106,8 @@ namespace sensor {
sensor_console
::
defineIntCommand
(
"co2"
,
setCO2forDebugging
,
F
(
"1500 (Sets co2 level, for debugging)"
));
sensor_console
::
defineIntCommand
(
"timer"
,
setTimer
,
F
(
"30 (Sets measurement interval, in s)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"(Starts calibration process)"
));
sensor_console
::
defineIntCommand
(
"calibrate"
,
calibrateSensorToSpecificPPM
,
F
(
"600 (Starts calibration process, to given ppm)"
));
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
F
(
"600 (Calibrates right now, to given ppm)"
));
sensor_console
::
defineCommand
(
"calibrate"
,
startCalibrationProcess
,
F
(
"(Starts calibration process, to 400ppm)"
));
sensor_console
::
defineCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
F
(
"600 (Calibrates right now, to given ppm)"
));
sensor_console
::
defineIntCommand
(
"auto_calibrate"
,
setAutoCalibration
,
F
(
"0/1 (Disables/enables autocalibration)"
));
}
...
...
@@ -158,8 +154,9 @@ namespace sensor {
void
calibrate
()
{
Serial
.
print
(
F
(
"Calibrating S8 now..."
));
//
FIXME: Apparently, only to 400ppm, though.
//
TODO: Apply ppm offset, e.g. +25ppm for 425ppm?
Serial
.
println
(
F
(
"WARNING! FORCING CALIBRATION TO 400ppm, regardless of configuration."
));
config
::
co2_calibration_level
=
400
;
//NOTE: Seems to be hard-coded in S8
sensor_S8
->
manual_calibration
();
Serial
.
println
(
F
(
" Done!"
));
Serial
.
println
(
F
(
"Sensor calibrated."
));
...
...
@@ -318,17 +315,8 @@ namespace sensor {
}
}
void
calibrateSensorToSpecificPPM
(
int32_t
calibrationLevel
)
{
Serial
.
println
(
F
(
"TODO: Implement ME!"
));
}
void
calibrateSensorRightNow
(
int32_t
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."
));
void
calibrateSensorRightNow
()
{
Serial
.
println
(
F
(
"Force calibration, right now!"
));
calibrate
();
}
}
}
ampel-firmware/web_config.cpp
View file @
096c204a
...
...
@@ -199,8 +199,9 @@ namespace web_config {
co2Params
.
addItem
(
&
temperatureOffsetParam
);
temperatureOffsetParam
.
visible
=
false
;
// Not needed for S8
co2Params
.
addItem
(
&
altitudeParam
);
altitudeParam
.
visible
=
false
;
// Not needed either
altitudeParam
.
visible
=
false
;
// Not needed either
for S8
co2Params
.
addItem
(
&
atmosphericCO2Param
);
atmosphericCO2Param
.
visible
=
false
;
// Hard coded 400ppm for S8 :-/
co2Params
.
addItem
(
&
autoCalibrateParam
);
ledParams
.
addItem
(
&
minBrightnessParam
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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