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: HIDScope Servo mbed QEI biquadFilter
Diff: THE.cpp
- Revision:
- 31:969635fd7f57
- Parent:
- 30:ec9e7116f1b0
- Child:
- 32:fad4b119dce0
--- a/THE.cpp Fri Nov 02 10:27:26 2018 +0000 +++ b/THE.cpp Fri Nov 02 10:43:27 2018 +0000 @@ -792,36 +792,49 @@ while(true) { demo_control(-pi/4.0,-pi/4.0); - if ((Counts1(counts1) > -26267-1000 )&& (Counts1(counts1) < -26267+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) < 13369+1000)) + if ((Counts2(counts2) > -26267-1000 )&& (Counts2(counts2) < -26267+1000)) { - translation_stop(); + rotation_stop(); - break; - } + + } + if ((Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000)) + {translation_stop();} + if ((Counts2(counts2) > -26267-1000 )&& (Counts2(counts2) < -26267+1000)&& (Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000)) + {break;} } while(true) { demo_control(pi,pi); - if ((Counts1(counts1) > -78802-1000 )&& (Counts1(counts1) < -78802+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) < 13369+1000)) + if ((Counts2(counts2) > -78802-1000 )&& (Counts2(counts2) < -78802+1000)) { - translation_stop(); + rotation_stop(); - break; - } + } + if ((Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000)) + {translation_stop(); } + if ((Counts2(counts2) > -78802-1000 )&& (Counts2(counts2) < -78802+1000) && (Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000)) + { break; + } + } while(true) { demo_control(pi/4.0,pi/4.0); - if ((Counts1(counts1) > -105069-1000 )&& (Counts1(counts1) < -105069+1000)&& (Counts2(counts2) > 24732-1000)&& (Counts2(counts2) < 24732+1000)) + if ((Counts2(counts2) > -105069-1000 )&& (Counts2(counts2) < -105069+1000)) { - translation_stop(); + rotation_stop(); - break; + } - } + if ((Counts1(counts1) > 24732-1000)&& (Counts1(counts1) < 24732+1000)) + {translation_stop();} + if ((Counts2(counts2) > -105069-1000 )&& (Counts2(counts2) < -105069+1000)&& (Counts1(counts1) > 24732-1000)&& (Counts1(counts1) < 24732+1000)) + {break;} } +} // FAILURE