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
Revision 3:ab87f97bfa06, committed 2015-03-03
- Comitter:
- m166588
- Date:
- Tue Mar 03 14:25:05 2015 +0000
- Parent:
- 2:1ef6c6f5dfe1
- Commit message:
- 920 with saturation
Changed in this revision
Turret_move.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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);