Engine control program with 3 engines Needs to make a case for each simultaneous engine setting, because of the WAIT after each number of bits have been sent.

Dependencies:   mbed-rtos mbed PinDetect

Fork of FinalMotorControl by Robot Bachelor

Revision:
20:d90bd1718078
Parent:
19:79600d3509d7
Child:
21:9f3ae352ee63
--- 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();
             }