Skip to content

Commit

Permalink
curio: fix flipping motor direction from + to -/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Nov 6, 2024
1 parent 5ac4b59 commit 138e069
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/js/misc/curio.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ Motor.prototype.setSpeed = function(speed) {
} else {
if (speed>0) {
this.pwm = this.M1;
this.M2.reset();
this.direction = 1;
} else if (speed<0) {
this.pwm = this.M2;
this.M1.reset();
this.direction = -1;
}
this.duty = 1;
Expand Down

0 comments on commit 138e069

Please sign in to comment.