Skip to content
Snippets Groups Projects
Commit 6f4f01a8 authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

Adding code so the motor turns in function of the clockwise equals push attribute

parent cc7a9ab4
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
...@@ -186,11 +186,11 @@ void SyringeFilled :: start_exchange() ...@@ -186,11 +186,11 @@ void SyringeFilled :: start_exchange()
if (get_push()) //If we want to deliver some liquid if (get_push()) //If we want to deliver some liquid
{ {
move_mm_limit_switch(exchange_volume_mm3/section_mm2); move_mm_limit_switch(_clockwise_equals_push? exchange_volume_mm3/section_mm2: -exchange_volume_mm3/section_mm2);
} }
else //If we want to recover some liquid else //If we want to recover some liquid
{ {
move_to_mm_limit_switch(exchange_volume_mm3/section_mm2); move_to_mm_limit_switch(_clockwise_equals_push? -exchange_volume_mm3/section_mm2: exchange_volume_mm3/section_mm2);
} }
...@@ -213,7 +213,7 @@ void SyringeFilled :: go_to_zero() ...@@ -213,7 +213,7 @@ void SyringeFilled :: go_to_zero()
{ {
set_speed_mm_per_sec(-1); set_speed_mm_per_sec(-1);
reset_position(); reset_position();
move_to_mm_limit_switch(-200); move_to_mm_limit_switch(_clockwise_equals_push? -200: 200);
} }
} }
...@@ -264,7 +264,7 @@ if (get_emergency()) ...@@ -264,7 +264,7 @@ if (get_emergency())
Serial.printf("EMERGENCY: running away slowly\n"); Serial.printf("EMERGENCY: running away slowly\n");
set_speed_mm_per_sec(-1); set_speed_mm_per_sec(-1);
reset_position(); reset_position();
move_to_mm_limit_switch(200); move_to_mm_limit_switch(_clockwise_equals_push? 200: -200);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment