summaryrefslogtreecommitdiff
path: root/tube-rotator/tube-rotator.c
diff options
context:
space:
mode:
Diffstat (limited to 'tube-rotator/tube-rotator.c')
-rw-r--r--tube-rotator/tube-rotator.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tube-rotator/tube-rotator.c b/tube-rotator/tube-rotator.c
index b1446b0..065dd2f 100644
--- a/tube-rotator/tube-rotator.c
+++ b/tube-rotator/tube-rotator.c
@@ -40,9 +40,10 @@ void handle_cmd(uint8_t cmd)
case '!': reset2bootloader(); break;
case 'r': led_on(); stepper_start(); break;
case 's': stepper_stop(); led_off(); break;
- case '+': stepper_inc_speed(); break;
- case '-': stepper_dec_speed(); break;
- case '2': stepper_set_speed_rpm(20); break;
+ case '*': stepper_inc_speed(); break;
+ case '+': stepper_inc_speed_rpm(); break;
+ case '-': stepper_dec_speed_rpm(); break;
+ case '_': stepper_dec_speed(); break;
case '3': stepper_set_speed_rpm(30); break;
case '4': stepper_set_speed_rpm(40); break;
case '5': stepper_set_speed_rpm(50); break;
@@ -51,9 +52,10 @@ void handle_cmd(uint8_t cmd)
case '8': stepper_set_speed_rpm(80); break;
case '9': stepper_set_speed_rpm(90); break;
case '0': stepper_set_speed_rpm(100); break;
- default: printf("Error(cmd): unknown command %02X '%c'\r\n", cmd, cmd); return;
+ case '1': stepper_set_speed_rpm(110); break;
+ case '2': stepper_set_speed_rpm(120); break;
}
- printf("target speed: %3d rpm\r", stepper_get_speed_rpm());
+ printf("state: %s, %3d rpm\r", stepper_state_to_string(stepper_get_state()), stepper_get_speed_rpm());
}
int main(void)