curio: fix flipping motor direction from + to -/etc

This commit is contained in:
Gordon Williams 2024-11-06 13:02:16 +00:00
parent 5ac4b591a3
commit 138e069602

View File

@ -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;