02/07/15

Dependencies:   mbed

Dependents:   TabbedGUIMbed

Revision:
65:08b3eb9b95dd
Parent:
63:7d2bff227f65
Child:
66:b642dac6f65d
--- a/main.cpp	Wed Aug 05 08:44:12 2015 +0000
+++ b/main.cpp	Wed Aug 05 09:02:17 2015 +0000
@@ -8,16 +8,20 @@
 Serial pc(USBTX, USBRX); // tx, rx 
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);
-void handshake();
+string handshake();
 void run();
 
 int main(void)
 {
     initialise(3);                                 //used to create the Datalog file should happen once for every bend test
-    handshake();      
-    pc.printf("hello2");
+    if (handshake() == "success")
+    {
+        run();
+    }      
+    pc.printf("main after");            //it works now!!!!!!!!!!!!!!!
+    led2= 1;
 }
-void handshake()
+string handshake()
 {
             unsigned char input;
              pc.printf("a\n");
@@ -28,7 +32,7 @@
                      if (input == 'a')
                      {
                          led1 = 1;
-                         run();
+                        return "success" ;// run();
                      }
                  }
 }