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 13:25:25 2016 +0000
Parent:
20:d90bd1718078
Child:
22:f6e328f7bd28
Commit message:
Put in some comments.

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:34:20 2016 +0000
+++ b/main.cpp	Tue May 03 13:25:25 2016 +0000
@@ -25,7 +25,7 @@
 static char m_cmd = 'x';
 
 
-
+//Methods to set pins to control direction.
 void stepAllRight()
 {
     //engine 1
@@ -311,6 +311,7 @@
     wait_us(fart);
 }
 
+//Method to release all engines.
 void stopAll()
 {
     IN1=0;
@@ -327,6 +328,7 @@
     IN12=0;
 }
 
+//Methods to release single engines.
 void stopE1()
 {
     IN1=0;
@@ -413,16 +415,19 @@
                 m_cmd = 'x';
                 
             }*/
+            
+            //Release all motors / Set all pins to 0
             if (m_cmd == 'z')
             {
                 stopAll();
             } 
-            
+            //Make all engines halt and hold still. 
             if (m_cmd == 'x')
             {
                 Thread::wait(5);
             }
   
+            //Controlling each motor seperately.
             //ENGINE 1
             if(m_cmd == '7')
             {