Updated readme, renamed Boost Interactive Motor to Boost Tacho Motor

This commit is contained in:
Nathan Kunicki 2018-08-07 11:11:57 +01:00
parent d2f3fcec72
commit d93b011cb9
7 changed files with 14 additions and 14 deletions

View File

@ -31,11 +31,11 @@ While most Powered UP components and Hubs are compatible with each other, there
* The Boost Color and Distance sensor only works in color mode with the WeDo 2.0 Smart Hub.
* When used with the WeDo 2.0 Smart Hub, the Boost Interactive Motor does not support rotating the motor by angle.
* When used with the WeDo 2.0 Smart Hub, the Boost Tacho Motor does not support rotating the motor by angle.
* When used with the Powered Up Hub, the Boost Interactive Motor does not support rotating the motor by angle. It also does not support rotation detection.
* When used with the Powered Up Hub, the Boost Tacho Motor does not support rotating the motor by angle. It also does not support rotation detection.
* Plugging two Boost Interactive Motors into the Powered Up Hub will crash the Hub (This requires a firmware update from LEGO to fix).
* Plugging two Boost Tacho Motors into the Powered Up Hub will crash the Hub (This requires a firmware update from LEGO to fix).
### Usage

View File

@ -31,11 +31,11 @@ While most Powered UP components and Hubs are compatible with each other, there
* The Boost Color and Distance sensor only works in color mode with the WeDo 2.0 Smart Hub.
* When used with the WeDo 2.0 Smart Hub, the Boost Interactive Motor does not support rotating the motor by angle.
* When used with the WeDo 2.0 Smart Hub, the Boost Tacho Motor does not support rotating the motor by angle.
* When used with the Powered Up Hub, the Boost Interactive Motor does not support rotating the motor by angle. It also does not support rotation detection.
* When used with the Powered Up Hub, the Boost Tacho Motor does not support rotating the motor by angle. It also does not support rotation detection.
* Plugging two Boost Interactive Motors into the Powered Up Hub will crash the Hub (This requires a firmware update from LEGO to fix).
* Plugging two Boost Tacho Motors into the Powered Up Hub will crash the Hub (This requires a firmware update from LEGO to fix).
### Usage

View File

@ -82,7 +82,7 @@ export class BoostMoveHub extends LPF2Hub {
return new Promise((resolve, reject) => {
if (time) {
if (portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR) {
if (portObj.type === Consts.Devices.BOOST_TACHO_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR) {
portObj.busy = true;
let data = null;
if (portObj.id === "AB") {
@ -109,7 +109,7 @@ export class BoostMoveHub extends LPF2Hub {
} else {
if (portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR) {
if (portObj.type === Consts.Devices.BOOST_TACHO_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR) {
portObj.busy = true;
let data = null;
if (portObj.id === "AB") {
@ -163,8 +163,8 @@ export class BoostMoveHub extends LPF2Hub {
*/
public setMotorAngle (port: string, angle: number, speed: number | [number, number] = 100) {
const portObj = this._portLookup(port);
if (!(portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR)) {
throw new Error("Angle rotation is only available when using a Boost Interactive Motor or Boost Move Hub Motor");
if (!(portObj.type === Consts.Devices.BOOST_TACHO_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR)) {
throw new Error("Angle rotation is only available when using a Boost Tacho Motor or Boost Move Hub Motor");
}
if (portObj.id !== "AB" && speed instanceof Array) {
throw new Error(`Port ${portObj.id} can only accept a single speed`);

View File

@ -14,7 +14,7 @@ export enum Devices {
WEDO2_TILT = 34,
WEDO2_DISTANCE = 35,
BOOST_DISTANCE = 37,
BOOST_INTERACTIVE_MOTOR = 38,
BOOST_TACHO_MOTOR = 38,
BOOST_MOVE_HUB_MOTOR = 39,
BOOST_TILT = 40,
POWERED_UP_REMOTE_BUTTON = 55

2
hub.ts
View File

@ -348,7 +348,7 @@ export class Hub extends EventEmitter {
return 0x02;
case Consts.Devices.TRAIN_MOTOR:
return 0x02;
case Consts.Devices.BOOST_INTERACTIVE_MOTOR:
case Consts.Devices.BOOST_TACHO_MOTOR:
return 0x02;
case Consts.Devices.BOOST_MOVE_HUB_MOTOR:
return 0x02;

View File

@ -280,7 +280,7 @@ export class LPF2Hub extends Hub {
this.emit("tilt", port.id, this._lastTiltX, this._lastTiltY);
break;
}
case Consts.Devices.BOOST_INTERACTIVE_MOTOR:
case Consts.Devices.BOOST_TACHO_MOTOR:
{
const rotation = data.readInt32LE(2);
/**

View File

@ -288,7 +288,7 @@ export class WeDo2SmartHub extends Hub {
this.emit("tilt", port.id, this._lastTiltX, this._lastTiltY);
break;
}
case Consts.Devices.BOOST_INTERACTIVE_MOTOR:
case Consts.Devices.BOOST_TACHO_MOTOR:
{
const rotation = data.readInt32LE(2);
/**