No.9 Robotics / Mbed 2 deprecated Robotics_DCMotor

Dependencies:   mbed

Fork of Robotics_Lab_DCMotor by LDSC_Robotics

Revision:
7:f7d503690ea5
Parent:
3:178ee1fe1c60
Child:
8:05ac8875cb1f
--- a/main.cpp	Wed Apr 13 09:07:29 2016 +0000
+++ b/main.cpp	Wed Apr 13 09:32:58 2016 +0000
@@ -25,8 +25,6 @@
 InterruptIn HallA_2(D13);
 InterruptIn HallB_2(D12);
 
-Serial pc(D1, D0);
-
 Ticker timer1;
 void timer1_interrupt(void);
 void CN_interrupt(void);
@@ -49,7 +47,6 @@
 int main() {
     
     bluetooth.baud(115200);
-    pc.baud(57600);
     
     init_TIMER();
     init_PWM();
@@ -66,8 +63,7 @@
         }
         if(bluetooth.readable())
         {
-            angle = bluetooth.getc();
-            pc.putc(speedCommand);
+            speedCommand = bluetooth.getc();
             
             if (speedCommand == 'a')
             { 
@@ -93,7 +89,7 @@
             if (v1_ref < -100)
                 v1_ref = -100;
             else if (v1_ref > 100)
-                v1_ref = 100
+                v1_ref = 100;
                 
             if (v2_ref < -100)
                 v2_ref = -100;
@@ -152,14 +148,14 @@
         if (stateB_1 == 0)
             state_1 = 1;
         else
-            stete_1 = 2;
+            state_1 = 2;
     }
     else
     {
         if (stateB_1 == 1)
             state_1 = 3;
         else
-            stete_1 = 4;
+            state_1 = 4;
     }
     
     //Forward: v1Count +1
@@ -181,14 +177,14 @@
         if (stateB_2 == 0)
             state_2 = 1;
         else
-            stete_2 = 2;
+            state_2 = 2;
     }
     else
     {
         if (stateB_2 == 1)
             state_2 = 3;
         else
-            stete_2 = 4;
+            state_2 = 4;
     }
     
     //Forward: v2Count +1