Robotic_winteam / Mbed 2 deprecated Nucleo_all

Dependencies:   mbed

Revision:
2:dc39c3de56c1
Parent:
1:8fb27fda4ec5
Child:
3:e4bdbe286f7a
--- a/main.cpp	Thu May 26 12:54:23 2016 +0000
+++ b/main.cpp	Fri May 27 02:37:20 2016 +0000
@@ -42,10 +42,10 @@
 int v2Count = 0;
 
 /*char Receive_Data;*/
-char Receive_Data[10];
-int Position_Error,Degree_Error;
-int Command_Flag;
-float sigma,delta,fSpeedRef_1,fSpeedRef_2;
+char Receive_Data[10],Temp;
+float Position_Error = 0.0,Degree_Error= 0.0;
+int Command_Flag,Receive_Counter,Receive_Flag;
+float sigma = 0.0,delta = 0.0,fSpeedRef_1 = 0.0,fSpeedRef_2 = 0.0;
 
  
 float v1 = 0.0, v1_ref = 0.0;
@@ -80,6 +80,8 @@
                 Degree_Error=-1*Degree_Error;
             else 
                 Degree_Error=Degree_Error;
+                
+            Command_Flag = 0;
             
   
             sigma = k1*Position_Error;
@@ -221,10 +223,7 @@
 }
 
 void BT_interrupt(void)
-{
-    int Receive_Counter,Receive_Flag;
-    
-    static char Temp;
+{  
     Temp = bluetooth.getc(); 
     
     if (Receive_Flag==1)
@@ -241,10 +240,10 @@
     }
     else
     {
-        if(Temp==36)
+        if(Temp == 36)
         {
-            Receive_Flag=1;
-            Receive_Counter=0;
+            Receive_Flag = 1;
+            Receive_Counter = 0;
             Receive_Data[0]= Temp;
         }
     }