My Version of CreaBotLib
Fork of CreaBotLib by
Diff: CreaBot.cpp
- Revision:
- 2:3d2d6d655d01
- Parent:
- 1:974d020bb582
- Child:
- 3:891b6a138383
--- a/CreaBot.cpp Thu Jul 27 21:27:15 2017 +0000 +++ b/CreaBot.cpp Fri Jul 28 12:42:49 2017 +0000 @@ -48,12 +48,12 @@ setSpeedLeft(current_speed); setSpeedRight(current_speed); angleWheel = angleBot*ratio_wheel_bot; - if(angleBot>0) { - moveMotorLeft(CLOCKWISE, angleWheel); - moveMotorRight(CLOCKWISE, angleWheel); + if(angleBot<0) { + moveMotorLeft(CLOCKWISE, -angleWheel); + moveMotorRight(CLOCKWISE, -angleWheel); } else { - moveMotorLeft(COUNTERCLOCKWISE, -angleWheel); - moveMotorRight(COUNTERCLOCKWISE, -angleWheel); + moveMotorLeft(COUNTERCLOCKWISE, angleWheel); + moveMotorRight(COUNTERCLOCKWISE, angleWheel); } } void Creabot::moveRight(float angle)