BE@R lab / motion_control

Dependencies:   motor_relay

Dependents:   dog_V3_3_testmotor

Files at this revision

API Documentation at this revision

Comitter:
soulx
Date:
Mon Dec 07 09:15:37 2015 +0000
Parent:
7:94518aee126b
Commit message:
??????????????????????

Changed in this revision

motion_control.cpp Show annotated file Show diff for this revision Revisions of this file
motion_control.h Show annotated file Show diff for this revision Revisions of this file
--- a/motion_control.cpp	Fri Jul 24 21:15:45 2015 +0000
+++ b/motion_control.cpp	Mon Dec 07 09:15:37 2015 +0000
@@ -30,12 +30,16 @@
                 motor.StopMotor();
             }
         } else {
-            motor.SetMotor(dirction);
+             motor.StopMotor();
+            return 1;
         }
         return 0;//Normally
     } else if(_limit_down) {
-        motor.SetMotor(1);
-        // }
+        if(mode_limit == 0) {
+            motor.SetMotor(1);
+        } else {
+            motor.StopMotor();
+        }
         return -1;
     } else {
         motor.SetMotor(dirction);
@@ -119,7 +123,7 @@
         sum += _position.read_u16();
     }
     MIN_POSITION = sum/LOOP;
-    
+
     SetMode(buff);
 }
 
--- a/motion_control.h	Fri Jul 24 21:15:45 2015 +0000
+++ b/motion_control.h	Mon Dec 07 09:15:37 2015 +0000
@@ -14,8 +14,8 @@
     void calibration();
 
     //limit
-    // open : '1'
-    // shot : '0'
+    // open : '0'
+    // shot : '1'
     int GetLimitUp(); 
     int GetLimitDown();