diff --git a/src/devices/tachomotor.ts b/src/devices/tachomotor.ts index 5f0aff3..3ae54f6 100644 --- a/src/devices/tachomotor.ts +++ b/src/devices/tachomotor.ts @@ -31,16 +31,16 @@ export class TachoMotor extends BasicMotor { * Rotate a motor by a given angle. * @method TachoMotor#rotateByAngle * @param {number} angle How much the motor should be rotated (in degrees). - * @param {number} [power=100] For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. + * @param {number} [speed=100] For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. * @returns {Promise} Resolved upon successful completion of command (ie. once the motor is finished). */ - public rotateByAngle (angle: number, power: number = 100) { + public rotateByAngle (angle: number, speed: number = 100) { if (this.isWeDo2SmartHub) { throw new Error("Angle rotation is not available on the WeDo 2.0 Smart Hub"); } return new Promise((resolve) => { this._busy = true; - const message = Buffer.from([0x81, this.portId, 0x11, 0x0b, 0x00, 0x00, 0x00, 0x00, mapSpeed(power), 0x64, 0x7f, 0x03]); + const message = Buffer.from([0x81, this.portId, 0x11, 0x0b, 0x00, 0x00, 0x00, 0x00, mapSpeed(speed), 0x64, 0x7f, 0x03]); message.writeUInt32LE(angle, 4); this.send(message); this._finished = () => { diff --git a/src/hubs/lpf2hub.ts b/src/hubs/lpf2hub.ts index 200fcc4..70bcdc1 100644 --- a/src/hubs/lpf2hub.ts +++ b/src/hubs/lpf2hub.ts @@ -401,20 +401,6 @@ export class LPF2Hub extends Hub { } } - // const port = this._getPortForPortNumber(data[3]); - - // if (!port) { - // return; - // } - - // if (data[4] === 0x0a) { - // port.busy = false; - // if (port.finished) { - // port.finished(); - // port.finished = null; - // } - // } - }