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:
- 2:1ef6c6f5dfe1
- Parent:
- 1:f60fe84699b4
- Child:
- 3:ab87f97bfa06
--- a/Turret_move.cpp Tue Mar 03 13:55:15 2015 +0000
+++ b/Turret_move.cpp Tue Mar 03 14:19:47 2015 +0000
@@ -11,29 +11,16 @@
while(1)
{
-
- printf("input_dc= %d \n user_direction = %d \n duty_cycle = %f \n", input_dc, user_direction, duty_cycle);
-
- wait(2);
-
- printf("Enter duty cycle:\n");
+ printf("Enter duty cycle, 0 to 100:\n");
scanf("%d", &input_dc);
- duty_cycle = input_dc/100.0;
+ duty_cycle = input_dc/100.0;
- printf("input_dc= %d \n user_direction = %d \n duty_cycle = %f \n", input_dc, user_direction, duty_cycle);
-
- wait(2);
-
- printf("%f duty cycle set. Enter 0 or 1 for spin direction:\n",duty_cycle);
+ printf("%f duty cycle set. Enter 0 for CCW or 1 for CW spin direction:\n",duty_cycle);
scanf("%d", &user_direction);
- printf("input_dc= %d \n user_direction = %d \n duty_cycle = %f \n", input_dc, user_direction, duty_cycle);
-
- wait(2);
-
turret_speed = duty_cycle;
turret_direction = user_direction;
- printf("%f duty cycle. %d spin.\n", duty_cycle, turret_direction);
+ printf("%f duty cycle. %d spin.\n", duty_cycle, user_direction);
}
}
\ No newline at end of file