Skip to content

Commit

Permalink
Brake function added
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonPucheu committed Feb 17, 2024
1 parent 446b6ca commit 79cd4fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Mecanum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ void Mecanum::stop()
motors[Right][Back].stop();
}

void Mecanum::brake()
{
motors[Left][Front].brake();
motors[Left][Back].brake();
motors[Right][Front].brake();
motors[Right][Back].brake();
}

void Mecanum::sideway(int speed)
{
if (speed > 0)
Expand Down
1 change: 1 addition & 0 deletions src/Mecanum.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Mecanum
void backward(int speed);
void move(int speed);
void stop();
void brake();
void sideway(int speed);
void sidewayLeft(int speed);
void sidewayRight(int speed);
Expand Down
1 change: 0 additions & 1 deletion src/Mecaside.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Mecaside
}
void move(int speed)
{
Serial.println(speed);
if (speed > 0)
forward(speed);
if (speed == 0)
Expand Down

0 comments on commit 79cd4fe

Please sign in to comment.