Drew Robinson / Mbed 2 deprecated sailbot_MASTFINAL

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
drewrobinson
Date:
Wed Nov 28 21:08:04 2018 +0000
Parent:
2:2195a4abdf8c
Commit message:
FINAL MAST

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 2195a4abdf8c -r d5480dc67a6d main.cpp
--- a/main.cpp	Wed Nov 28 21:00:21 2018 +0000
+++ b/main.cpp	Wed Nov 28 21:08:04 2018 +0000
@@ -74,26 +74,23 @@
         if((pos > (d_ang-3.0))) {
             motor.pulsewidth(0);
             slp = 0;
+            
         }
         if( (pos > (d_ang+3.0))) {
             slp = 1;
-            while(pos > d_ang) {
                 dir = 1; //left??
                 motor.pulsewidth(.0005);
                 //pc.printf("pos: %.3f\n",pos);
+                Thread::wait(10);
                 pos = posi();
-            }//while pos
-            motor.pulsewidth(0);
         }//if pos
         if((pos < (d_ang-3.0)) && pos > 90.0) {
             slp = 1;
-            while(pos < d_ang) {
                 dir = 0; //right??
                 motor.pulsewidth(.0005);
                 //pc.printf("pos: %.3f\n",pos);
+                Thread::wait(10);
                 pos = posi();
-            }//while pos
-            motor.pulsewidth(0);
         }
         //***END OF JUST ADDED
         ThisThread::sleep_until(121);