Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: LineFollowingRobot/RobotControl.cpp
- 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; }