Commit 79f137e8 authored by Eric Duminil's avatar Eric Duminil
Browse files

co2_sensor: Add F-Strings

parent 0721221d
...@@ -84,13 +84,13 @@ namespace sensor { ...@@ -84,13 +84,13 @@ namespace sensor {
Serial.print(F("Setting temperature offset to -")); Serial.print(F("Setting temperature offset to -"));
Serial.print(abs(config::temperature_offset)); 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. scd30.setTemperatureOffset(abs(config::temperature_offset)); // setTemperatureOffset only accepts positive numbers, but shifts the temperature down.
delay(100); delay(100);
Serial.print(F("Temperature offset is : -")); Serial.print(F("Temperature offset is : -"));
Serial.print(scd30.getTemperatureOffset()); Serial.print(scd30.getTemperatureOffset());
Serial.println(" K"); Serial.println(F(" K"));
Serial.print(F("Auto-calibration is ")); Serial.print(F("Auto-calibration is "));
Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF."); Serial.println(config::auto_calibrate_sensor ? "ON." : "OFF.");
...@@ -100,7 +100,7 @@ namespace sensor { ...@@ -100,7 +100,7 @@ namespace sensor {
Serial.println(); Serial.println();
Serial.print(F("Setting SCD30 timestep to ")); Serial.print(F("Setting SCD30 timestep to "));
Serial.print(config::measurement_timestep_bootup); Serial.print(config::measurement_timestep_bootup);
Serial.println(" s during acclimatization."); Serial.println(F(" s during acclimatization."));
scd30.setMeasurementInterval(config::measurement_timestep_bootup); // [s] scd30.setMeasurementInterval(config::measurement_timestep_bootup); // [s]
sensor_console::defineIntCommand("co2", setCO2forDebugging, F(" 1500 (Sets co2 level, for debugging purposes)")); sensor_console::defineIntCommand("co2", setCO2forDebugging, F(" 1500 (Sets co2 level, for debugging purposes)"));
...@@ -120,7 +120,7 @@ namespace sensor { ...@@ -120,7 +120,7 @@ namespace sensor {
int32_t now = millis(); int32_t now = millis();
Serial.print(F("Measurement time offset : ")); Serial.print(F("Measurement time offset : "));
Serial.print(now - previous_measurement_at - config::measurement_timestep * 1000); Serial.print(now - previous_measurement_at - config::measurement_timestep * 1000);
Serial.println(" ms."); Serial.println(F(" ms."));
previous_measurement_at = now; previous_measurement_at = now;
} }
...@@ -189,7 +189,7 @@ namespace sensor { ...@@ -189,7 +189,7 @@ namespace sensor {
if (config::debug_sensor_states) { if (config::debug_sensor_states) {
Serial.print(F("Changing sensor state: ")); Serial.print(F("Changing sensor state: "));
Serial.print(state_names[current_state]); Serial.print(state_names[current_state]);
Serial.print(" -> "); Serial.print(F(" -> "));
Serial.println(state_names[new_state]); Serial.println(state_names[new_state]);
} }
current_state = new_state; current_state = new_state;
...@@ -204,7 +204,7 @@ namespace sensor { ...@@ -204,7 +204,7 @@ namespace sensor {
Serial.println(F("Sensor acclimatization finished.")); Serial.println(F("Sensor acclimatization finished."));
Serial.print(F("Setting SCD30 timestep to ")); Serial.print(F("Setting SCD30 timestep to "));
Serial.print(config::measurement_timestep); Serial.print(config::measurement_timestep);
Serial.println(" s."); Serial.println(F(" s."));
scd30.setMeasurementInterval(config::measurement_timestep); // [s] scd30.setMeasurementInterval(config::measurement_timestep); // [s]
} }
if ((current_state == PREPARE_CALIBRATION_UNSTABLE) || (current_state == PREPARE_CALIBRATION_STABLE)) { if ((current_state == PREPARE_CALIBRATION_UNSTABLE) || (current_state == PREPARE_CALIBRATION_STABLE)) {
...@@ -306,7 +306,7 @@ namespace sensor { ...@@ -306,7 +306,7 @@ namespace sensor {
if (timestep >= 2 && timestep <= 1800) { if (timestep >= 2 && timestep <= 1800) {
Serial.print(F("Setting Measurement Interval to : ")); Serial.print(F("Setting Measurement Interval to : "));
Serial.print(timestep); Serial.print(timestep);
Serial.println("s."); Serial.println(F("s."));
sensor::scd30.setMeasurementInterval(timestep); sensor::scd30.setMeasurementInterval(timestep);
config::measurement_timestep = timestep; config::measurement_timestep = timestep;
led_effects::showKITTWheel(color::green, 1); led_effects::showKITTWheel(color::green, 1);
...@@ -318,7 +318,7 @@ namespace sensor { ...@@ -318,7 +318,7 @@ namespace sensor {
Serial.print(F("Force calibration, at ")); Serial.print(F("Force calibration, at "));
config::co2_calibration_level = calibrationLevel; config::co2_calibration_level = calibrationLevel;
Serial.print(config::co2_calibration_level); Serial.print(config::co2_calibration_level);
Serial.println(" ppm."); Serial.println(F(" ppm."));
sensor::startCalibrationProcess(); sensor::startCalibrationProcess();
} }
} }
......
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