Damian Herman / Mbed 2 deprecated NetrunnerMain

Dependencies:   mbed

Revision:
2:09cc6b203fe4
Parent:
1:90d75436758b
Child:
3:def8a92db030
--- a/main.cpp	Mon Jun 22 15:47:43 2015 +0000
+++ b/main.cpp	Tue Jun 23 08:32:15 2015 +0000
@@ -1,13 +1,27 @@
 #include "mbed.h"
 #include "include/EngineDriver.h"
-
+Serial pc(SERIAL_TX, SERIAL_RX);
+int initDrivingUnit(int testLoops)
+{
+        pc.printf("Testing engines...\n\r");
+        enableAll();
+        int i = 0;
+        while(i < testLoops)
+        {
+            testEngines();
+            applyStates();
+            i++;
+        }
+    resetEngines();
+    return 0;
+}
 int main()
 {
-    enableAll();
-    
+    if(initDrivingUnit(5) == 0)
+    {
+        pc.printf("Ready to accept commands.\n\r$>");
+    }
     while (true) 
     {
-        testEngines();
-        // Do other things...
     }
 }
\ No newline at end of file