Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert the direction of left wheel to account for mirrored wheel installation. #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Invert the direction of left wheel to account for mirrored wheel
installation.
  • Loading branch information
bitmole committed Aug 27, 2020
commit b2857fe8b8c429df9049119fda3e7e6908f095cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,34 +77,34 @@ void loop()
Serial.print(" ");
Serial.println(distance.toInt());

if (botDirection == "f") //if the entered direction is forward
if (botDirection == "f") //if the entered direction is forward
{
rightMotor(200); //drive the right wheel forward
leftMotor(200); //drive the left wheel forward
leftMotor(-200); //drive the left wheel backward
delay(driveTime * distance.toInt()); //drive the motors long enough travel the entered distance
rightMotor(0); //turn the right motor off
leftMotor(0); //turn the left motor off
}
else if (botDirection == "b") //if the entered direction is backward
{
rightMotor(-200); //drive the right wheel forward
leftMotor(-200); //drive the left wheel forward
rightMotor(-200); //drive the right wheel backward
leftMotor(200); //drive the left wheel forward
delay(driveTime * distance.toInt()); //drive the motors long enough travel the entered distance
rightMotor(0); //turn the right motor off
leftMotor(0); //turn the left motor off
}
else if (botDirection == "r") //if the entered direction is right
{
rightMotor(-200); //drive the right wheel forward
leftMotor(255); //drive the left wheel forward
rightMotor(-200); //drive the right wheel backward
leftMotor(-255); //drive the left wheel backward
delay(turnTime * distance.toInt()); //drive the motors long enough turn the entered distance
rightMotor(0); //turn the right motor off
leftMotor(0); //turn the left motor off
}
else if (botDirection == "l") //if the entered direction is left
else if (botDirection == "l") //if the entered direction is left
{
rightMotor(255); //drive the right wheel forward
leftMotor(-200); //drive the left wheel forward
leftMotor(200); //drive the left wheel forward
delay(turnTime * distance.toInt()); //drive the motors long enough turn the entered distance
rightMotor(0); //turn the right motor off
leftMotor(0); //turn the left motor off
Expand Down