Pipeline Technology Centre / Mbed 2 deprecated PTCSpeed_MBED1

Dependencies:   mbed mbed-rtos

Revision:
2:4dd54b3934a5
Parent:
0:efdae9d24ee1
diff -r efdae9d24ee1 -r 4dd54b3934a5 main.cpp
--- a/main.cpp	Wed Jul 22 13:12:14 2015 +0000
+++ b/main.cpp	Thu Aug 06 14:49:27 2015 +0000
@@ -1,13 +1,56 @@
 #include "mbed.h"
-//#include "Calculate.h"
-//#include "Distance.h"
-//#include "Data.h"
+#include <string.h>
+#include "rtos.h"
+#include "SpeedCalculate.h"
+#include "Data.h"
 #include "UserInput.h"
-//#include "Counter.h
+
+LocalFileSystem local("local");
+
+Serial pc(USBTX, USBRX); //conection to PC
+Serial mbed2(p9,p10); //conection to mbed2
+DigitalOut led_indactor(LED1);
+
+Data data;
+
+void speed_thread(void const *args)
+{   
+    SpeedCalculate speed;  
+    
+    speed.calculate(1,4);
+}
 
-Serial pc(USBTX, USBRX); // tx, rx
-Serial mbed2(p9,p10); //tx, rx 
+void handShake()
+{
+    unsigned char input;
+    pc.printf("a\n");
+              
+    while(true)
+    {
+        input = pc.getc();
+        if (input == 'a')
+        {   
+        led_indactor = 1;
+        break;
+        }
+    }
+} 
 
-int main(){
-    UI_DistanceB();
-} 
\ No newline at end of file
+int main()
+{ 
+    int number = 2;
+    //handShake();
+//    data.initialise();    
+//    while(!(pc.readable() && pc.getc() == 'b')){
+//        //run
+//        }
+//    Thread sThread(speed_thread);
+//    while(!(pc.readable() && pc.getc() == 's')){
+//        //run
+//        }
+//    sThread.terminate(); 
+    mbed2.printf("%d", number);
+    while(!mbed2.readable()){}
+    mbed2.scanf("%d", &number);
+    pc.printf("%d", number);
+}
\ No newline at end of file