Commit 096c204a authored by Eric Duminil's avatar Eric Duminil
Browse files

Hard coded 400ppm for S8 :-/

parent ba12d7f6
Pipeline #6595 passed with stage
in 2 minutes and 5 seconds
...@@ -68,8 +68,7 @@ namespace sensor { ...@@ -68,8 +68,7 @@ namespace sensor {
state current_state = BOOTUP; state current_state = BOOTUP;
void switchState(state); void switchState(state);
void setCO2forDebugging(int32_t fakeCo2); void setCO2forDebugging(int32_t fakeCo2);
void calibrateSensorToSpecificPPM(int32_t calibrationLevel); void calibrateSensorRightNow();
void calibrateSensorRightNow(int32_t calibrationLevel);
void setAutoCalibration(int32_t autoCalibration); void setAutoCalibration(int32_t autoCalibration);
void setTimer(int32_t timestep); void setTimer(int32_t timestep);
...@@ -107,11 +106,8 @@ namespace sensor { ...@@ -107,11 +106,8 @@ namespace sensor {
sensor_console::defineIntCommand("co2", setCO2forDebugging, F("1500 (Sets co2 level, for debugging)")); 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::defineIntCommand("timer", setTimer, F("30 (Sets measurement interval, in s)"));
sensor_console::defineCommand("calibrate", startCalibrationProcess, F("(Starts calibration process)")); sensor_console::defineCommand("calibrate", startCalibrationProcess, F("(Starts calibration process, to 400ppm)"));
sensor_console::defineIntCommand("calibrate", calibrateSensorToSpecificPPM, sensor_console::defineCommand("calibrate!", calibrateSensorRightNow, F("600 (Calibrates right now, to given ppm)"));
F("600 (Starts calibration process, to given ppm)"));
sensor_console::defineIntCommand("calibrate!", calibrateSensorRightNow,
F("600 (Calibrates right now, to given ppm)"));
sensor_console::defineIntCommand("auto_calibrate", setAutoCalibration, F("0/1 (Disables/enables autocalibration)")); sensor_console::defineIntCommand("auto_calibrate", setAutoCalibration, F("0/1 (Disables/enables autocalibration)"));
} }
...@@ -158,8 +154,9 @@ namespace sensor { ...@@ -158,8 +154,9 @@ namespace sensor {
void calibrate() { void calibrate() {
Serial.print(F("Calibrating S8 now...")); 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.")); 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(); sensor_S8->manual_calibration();
Serial.println(F(" Done!")); Serial.println(F(" Done!"));
Serial.println(F("Sensor calibrated.")); Serial.println(F("Sensor calibrated."));
...@@ -318,17 +315,8 @@ namespace sensor { ...@@ -318,17 +315,8 @@ namespace sensor {
} }
} }
void calibrateSensorToSpecificPPM(int32_t calibrationLevel) { void calibrateSensorRightNow() {
Serial.println(F("TODO: Implement ME!")); Serial.println(F("Force calibration, right now!"));
} calibrate();
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."));
calibrate();
}
} }
} }
...@@ -199,8 +199,9 @@ namespace web_config { ...@@ -199,8 +199,9 @@ namespace web_config {
co2Params.addItem(&temperatureOffsetParam); co2Params.addItem(&temperatureOffsetParam);
temperatureOffsetParam.visible = false; // Not needed for S8 temperatureOffsetParam.visible = false; // Not needed for S8
co2Params.addItem(&altitudeParam); co2Params.addItem(&altitudeParam);
altitudeParam.visible = false; // Not needed either altitudeParam.visible = false; // Not needed either for S8
co2Params.addItem(&atmosphericCO2Param); co2Params.addItem(&atmosphericCO2Param);
atmosphericCO2Param.visible = false; // Hard coded 400ppm for S8 :-/
co2Params.addItem(&autoCalibrateParam); co2Params.addItem(&autoCalibrateParam);
ledParams.addItem(&minBrightnessParam); ledParams.addItem(&minBrightnessParam);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment