Skip to content

Commit

Permalink
Make sure to initialize motor speeds (#149)
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Servin <[email protected]>
  • Loading branch information
garyservin authored Sep 10, 2023
1 parent 09955ad commit 0cb2c69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion andino_firmware/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ void loop() {

// Run a PID calculation at the appropriate intervals
if (millis() > nextPID) {
int left_motor_speed, right_motor_speed;
int left_motor_speed = 0;
int right_motor_speed = 0;
left_pid_controller.compute(readEncoder(LEFT), left_motor_speed);
right_pid_controller.compute(readEncoder(RIGHT), right_motor_speed);
left_motor.set_speed(left_motor_speed);
Expand Down

0 comments on commit 0cb2c69

Please sign in to comment.