Nicolae Marton / Mbed 2 deprecated TDP3_OOP

Dependencies:   mbed

Revision:
4:645b5d648c64
Parent:
3:54c41af9e119
diff -r 54c41af9e119 -r 645b5d648c64 LineFollowingRobot/RobotControl.cpp
--- a/LineFollowingRobot/RobotControl.cpp	Sun Feb 03 16:42:44 2019 +0000
+++ b/LineFollowingRobot/RobotControl.cpp	Wed Feb 06 14:02:07 2019 +0000
@@ -19,18 +19,18 @@
     
 void RobotControl::SetDirection(bool dir){
     /*set direction of one of the sides depending on pwmSelect
-    direction : 1 go forward  ,0 go backwards */    
+    direction : 1 go backwards  ,0 go forward*/    
     
     m_motorBw.write(0);
     m_motorFw.write(0);
     
-    wait(0.1);
+    wait(0.001);
         
-    if(dir){
-        m_motorEnable = true;
+    if(!dir){
+        m_motorEnable = false;
         m_pwmPtr = &m_motorFw;
     }else{
-        m_motorEnable = false;
+        m_motorEnable = true;
         m_pwmPtr = &m_motorBw;
     }