Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
b586cdf9
Commit
b586cdf9
authored
3 years ago
by
Käppler
Browse files
Options
Download
Email Patches
Plain Diff
co2_sensor: Add console command for SCD30 reset
parent
6412c4ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ampel-firmware/co2_sensor.cpp
+7
-0
ampel-firmware/co2_sensor.cpp
ampel-firmware/co2_sensor.h
+1
-0
ampel-firmware/co2_sensor.h
with
8 additions
and
0 deletions
+8
-0
ampel-firmware/co2_sensor.cpp
+
7
-
0
View file @
b586cdf9
...
@@ -113,6 +113,7 @@ namespace sensor {
...
@@ -113,6 +113,7 @@ namespace sensor {
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
sensor_console
::
defineIntCommand
(
"calibrate!"
,
calibrateSensorRightNow
,
F
(
"600 (Calibrates right now, to given ppm)"
));
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)"
));
sensor_console
::
defineCommand
(
"reset_scd"
,
resetSCD
,
F
(
"(Resets SCD30)"
));
}
}
bool
hasSensorSettled
()
{
bool
hasSensorSettled
()
{
...
@@ -328,4 +329,10 @@ namespace sensor {
...
@@ -328,4 +329,10 @@ namespace sensor {
calibrateAndRestart
();
calibrateAndRestart
();
}
}
}
}
void
resetSCD
()
{
Serial
.
print
(
F
(
"Resetting SCD30..."
));
scd30
.
reset
();
Serial
.
println
(
F
(
"done."
));
}
}
}
This diff is collapsed.
Click to expand it.
ampel-firmware/co2_sensor.h
+
1
-
0
View file @
b586cdf9
...
@@ -33,5 +33,6 @@ namespace sensor {
...
@@ -33,5 +33,6 @@ namespace sensor {
void
calibrateSensorToSpecificPPM
(
int32_t
calibrationLevel
);
void
calibrateSensorToSpecificPPM
(
int32_t
calibrationLevel
);
void
calibrateSensorRightNow
(
int32_t
calibrationLevel
);
void
calibrateSensorRightNow
(
int32_t
calibrationLevel
);
void
setAutoCalibration
(
int32_t
autoCalibration
);
void
setAutoCalibration
(
int32_t
autoCalibration
);
void
resetSCD
();
}
}
#endif
#endif
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets