Robot Bachelor / Mbed 2 deprecated MC

Dependencies:   mbed-rtos mbed PinDetect

Fork of FinalMotorControl by Robot Bachelor

Files at this revision

API Documentation at this revision

Comitter:
mjhaugsdal
Date:
Tue May 03 12:34:20 2016 +0000
Parent:
19:79600d3509d7
Child:
21:9f3ae352ee63
Commit message:
Made each motor release before running.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue May 03 12:27:31 2016 +0000
+++ b/main.cpp	Tue May 03 12:34:20 2016 +0000
@@ -327,6 +327,31 @@
     IN12=0;
 }
 
+void stopE1()
+{
+    IN1=0;
+    IN2=0;
+    IN3=0;
+    IN4=0;
+    
+}
+void stopE2()
+{
+    IN5=0;
+    IN6=0;
+    IN7=0;
+    IN8=0;
+    
+}
+void stopE3()
+{
+    IN9=0;
+    IN10=0;
+    IN11=0;
+    IN12=0;
+    
+}
+
 
 
 
@@ -402,33 +427,39 @@
             if(m_cmd == '7')
             {
                 //fart = 1200;
+                stopE1();
                 stepEngine1Left();
             }
             else if (m_cmd == '9')
             {
                 //fart = 1200;
+                stopE1();
                 stepEngine1Right();
             }
             //ENGINE 2
             else if (m_cmd == '4')
             {
                 //fart = 1200;
+                stopE2();
                 stepEngine2Left();
             }
             else if (m_cmd == '6')
             {
                 //fart = 1200;
+                stopE2();
                 stepEngine2Right();
             }
             //ENGINE 3
             else if (m_cmd == '1')
             {
                 //fart = 1200;
+                stopE3();
                 stepEngine3Left();
             }
             else if (m_cmd == '3')
             {
                 //fart = 1200;
+                stopE3();
                 stepEngine3Right();
             }