From 4cf54971a2f8620f960c45293b773b45beb9d3f3 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Wed, 23 Jun 2021 17:16:17 +0100 Subject: [PATCH] Added a command to check if the stage is moving --- .gitignore | 1 + src/modules/stage/stage.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 89cc49c..933c44f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +.venv/ \ No newline at end of file diff --git a/src/modules/stage/stage.cpp b/src/modules/stage/stage.cpp index c37c1f0..4949ddc 100644 --- a/src/modules/stage/stage.cpp +++ b/src/modules/stage/stage.cpp @@ -267,6 +267,12 @@ void stage_stop(String command) Serial.println("Move aborted"); } +void is_stage_moving(String command) +{ + //TODO: should I bother checking for a ? + Serial.println(stage_moving?"true":"false"); +} + //TODO: move help strings to program memory //F() cannot be used outside block context though extern const Command stage_commands[] = { @@ -279,6 +285,7 @@ extern const Command stage_commands[] = { {"ramp_time", stage_ramp_time}, {"min_step_delay", stage_min_step_delay}, {"dt", stage_min_step_delay}, - {"zero", stage_min_step_delay}, + {"zero", stage_zero}, {"stop", stage_stop}, + {"moving", is_stage_moving}, END_COMMAND}; \ No newline at end of file