mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
curio: fix flipping motor direction from + to -/etc
This commit is contained in:
parent
5ac4b591a3
commit
138e069602
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user