Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Turret_move.cpp
- Revision:
- 3:ab87f97bfa06
- Parent:
- 2:1ef6c6f5dfe1
diff -r 1ef6c6f5dfe1 -r ab87f97bfa06 Turret_move.cpp
--- a/Turret_move.cpp Tue Mar 03 14:19:47 2015 +0000
+++ b/Turret_move.cpp Tue Mar 03 14:25:05 2015 +0000
@@ -14,6 +14,14 @@
printf("Enter duty cycle, 0 to 100:\n");
scanf("%d", &input_dc);
duty_cycle = input_dc/100.0;
+ if (duty_cycle >=1.0)
+ {
+ duty_cycle = 1.0;
+ }
+ if (duty_cycle <= 0.0)
+ {
+ duty_cycle = 0.0;
+ }
printf("%f duty cycle set. Enter 0 for CCW or 1 for CW spin direction:\n",duty_cycle);
scanf("%d", &user_direction);