This commit is contained in:
parent
bcc59ce81c
commit
6decc7139b
@ -84,9 +84,7 @@ export class AbsoluteMotor extends TachoMotor {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const oldMode = this.mode;
|
const oldMode = this.mode;
|
||||||
let calibrated = false;
|
let calibrated = false;
|
||||||
this.requestUpdate();
|
|
||||||
this.on("absolute", async ({ angle }) => {
|
this.on("absolute", async ({ angle }) => {
|
||||||
console.log(angle);
|
|
||||||
if (!calibrated) {
|
if (!calibrated) {
|
||||||
calibrated = true;
|
calibrated = true;
|
||||||
if (angle < 0) {
|
if (angle < 0) {
|
||||||
@ -94,7 +92,6 @@ export class AbsoluteMotor extends TachoMotor {
|
|||||||
} else {
|
} else {
|
||||||
speed = -speed;
|
speed = -speed;
|
||||||
}
|
}
|
||||||
console.log(angle, speed);
|
|
||||||
await this.rotateByDegrees(angle, speed);
|
await this.rotateByDegrees(angle, speed);
|
||||||
if (oldMode) {
|
if (oldMode) {
|
||||||
this.subscribe(oldMode);
|
this.subscribe(oldMode);
|
||||||
@ -102,6 +99,7 @@ export class AbsoluteMotor extends TachoMotor {
|
|||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.requestUpdate();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user