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 Apr 26 13:28:52 2016 +0000
Parent:
10:17a16ceb376b
Child:
12:de8381ca371d
Commit message:
Put each engine in threads

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Apr 26 13:10:22 2016 +0000
+++ b/main.cpp	Tue Apr 26 13:28:52 2016 +0000
@@ -14,7 +14,7 @@
 DigitalOut IN5(D3);
 DigitalOut IN6(D4);
 DigitalOut IN7(D5);
-DigitalOut IN8(D6)
+DigitalOut IN8(D6);
 /*
 //Third engine 9-12
 DigitalOut IN9(D8);
@@ -212,6 +212,17 @@
     wait_us(fart);
 }
 
+void motor2(void const *args)
+{
+    while(true)
+    {
+        if(m_cmd == 't')
+        {
+            step4Left2();
+        }
+    }
+}
+
   
 void input(void const *args)
 {
@@ -232,6 +243,7 @@
 {
         //Thread 1 has constant feed from usb
         Thread t1(input);
+        Thread t2(motor2);
         static char global_direction;
         printf("Started");