diff --git a/docs/AbsoluteMotor.html b/docs/AbsoluteMotor.html index d148c08..5aecad4 100644 --- a/docs/AbsoluteMotor.html +++ b/docs/AbsoluteMotor.html @@ -33,14 +33,14 @@ @@ -2126,9 +2126,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/BaseHub.html b/docs/BaseHub.html index ff526c5..728ec39 100644 --- a/docs/BaseHub.html +++ b/docs/BaseHub.html @@ -33,14 +33,14 @@ @@ -142,7 +142,7 @@ @@ -300,7 +300,7 @@ @@ -419,7 +419,7 @@ @@ -538,7 +538,7 @@ @@ -657,7 +657,7 @@ @@ -776,7 +776,7 @@ @@ -895,7 +895,7 @@ @@ -1014,7 +1014,7 @@ @@ -1133,7 +1133,7 @@ @@ -1252,7 +1252,7 @@ @@ -1323,9 +1323,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/BasicMotor.html b/docs/BasicMotor.html index 28b8cfc..f8225e0 100644 --- a/docs/BasicMotor.html +++ b/docs/BasicMotor.html @@ -33,14 +33,14 @@ @@ -1620,9 +1620,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/BoostMoveHub.html b/docs/BoostMoveHub.html index 57d994e..267a78b 100644 --- a/docs/BoostMoveHub.html +++ b/docs/BoostMoveHub.html @@ -33,14 +33,14 @@ @@ -279,7 +279,7 @@ @@ -596,7 +596,7 @@ @@ -767,7 +767,7 @@ @@ -891,7 +891,7 @@ @@ -1062,7 +1062,7 @@ @@ -1526,7 +1526,7 @@ @@ -1698,7 +1698,7 @@ @@ -1870,7 +1870,7 @@ @@ -2042,7 +2042,7 @@ @@ -2221,7 +2221,7 @@ @@ -2392,7 +2392,7 @@ @@ -2539,7 +2539,7 @@ @@ -2636,7 +2636,7 @@ @@ -2713,9 +2713,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/ColorDistanceSensor.html b/docs/ColorDistanceSensor.html index 4e0e71d..062331d 100644 --- a/docs/ColorDistanceSensor.html +++ b/docs/ColorDistanceSensor.html @@ -33,14 +33,14 @@ @@ -1081,7 +1081,7 @@ @@ -1243,7 +1243,7 @@ @@ -1406,7 +1406,7 @@ @@ -1616,7 +1616,7 @@ @@ -1827,7 +1827,7 @@ @@ -2171,7 +2171,7 @@ @@ -2315,7 +2315,7 @@ @@ -2392,9 +2392,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/ControlPlusHub.html b/docs/ControlPlusHub.html index 5511f74..d0e34d0 100644 --- a/docs/ControlPlusHub.html +++ b/docs/ControlPlusHub.html @@ -33,14 +33,14 @@ @@ -279,7 +279,7 @@ @@ -596,7 +596,7 @@ @@ -767,7 +767,7 @@ @@ -891,7 +891,7 @@ @@ -1062,7 +1062,7 @@ @@ -1526,7 +1526,7 @@ @@ -1698,7 +1698,7 @@ @@ -1870,7 +1870,7 @@ @@ -2042,7 +2042,7 @@ @@ -2221,7 +2221,7 @@ @@ -2392,7 +2392,7 @@ @@ -2539,7 +2539,7 @@ @@ -2636,7 +2636,7 @@ @@ -2713,9 +2713,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/CurrentSensor.html b/docs/CurrentSensor.html index 8d108c4..9570e8e 100644 --- a/docs/CurrentSensor.html +++ b/docs/CurrentSensor.html @@ -33,14 +33,14 @@ @@ -1168,9 +1168,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/Device.html b/docs/Device.html index 657d910..4066479 100644 --- a/docs/Device.html +++ b/docs/Device.html @@ -33,14 +33,14 @@ @@ -966,9 +966,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/DuploTrainBase.html b/docs/DuploTrainBase.html index a4c8601..79a33e9 100644 --- a/docs/DuploTrainBase.html +++ b/docs/DuploTrainBase.html @@ -33,14 +33,14 @@ @@ -315,7 +315,7 @@ @@ -443,7 +443,7 @@ @@ -571,7 +571,7 @@ @@ -699,7 +699,7 @@ @@ -827,7 +827,7 @@ @@ -955,7 +955,7 @@ @@ -1083,7 +1083,7 @@ @@ -1211,7 +1211,7 @@ @@ -1339,7 +1339,7 @@ @@ -2000,7 +2000,7 @@ @@ -2077,9 +2077,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/DuploTrainBaseColorSensor.html b/docs/DuploTrainBaseColorSensor.html index 4c9783e..654aec4 100644 --- a/docs/DuploTrainBaseColorSensor.html +++ b/docs/DuploTrainBaseColorSensor.html @@ -33,14 +33,14 @@ @@ -1504,9 +1504,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/DuploTrainBaseMotor.html b/docs/DuploTrainBaseMotor.html index cf7ed21..f67fa17 100644 --- a/docs/DuploTrainBaseMotor.html +++ b/docs/DuploTrainBaseMotor.html @@ -33,14 +33,14 @@ @@ -1656,9 +1656,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/DuploTrainBaseSpeaker.html b/docs/DuploTrainBaseSpeaker.html index b427cad..1ae67da 100644 --- a/docs/DuploTrainBaseSpeaker.html +++ b/docs/DuploTrainBaseSpeaker.html @@ -33,14 +33,14 @@ @@ -1348,9 +1348,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/DuploTraniBaseSpeedometer.html b/docs/DuploTraniBaseSpeedometer.html index 225529a..a4adea0 100644 --- a/docs/DuploTraniBaseSpeedometer.html +++ b/docs/DuploTraniBaseSpeedometer.html @@ -33,14 +33,14 @@ @@ -1020,9 +1020,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/Hub.html b/docs/Hub.html index a7d26d6..8a7e7c2 100644 --- a/docs/Hub.html +++ b/docs/Hub.html @@ -33,14 +33,14 @@ @@ -315,7 +315,7 @@ @@ -443,7 +443,7 @@ @@ -571,7 +571,7 @@ @@ -699,7 +699,7 @@ @@ -827,7 +827,7 @@ @@ -955,7 +955,7 @@ @@ -1083,7 +1083,7 @@ @@ -1211,7 +1211,7 @@ @@ -1339,7 +1339,7 @@ @@ -1421,7 +1421,7 @@ @@ -1729,7 +1729,7 @@ @@ -1891,7 +1891,7 @@ @@ -2006,7 +2006,7 @@ @@ -2168,7 +2168,7 @@ @@ -2623,7 +2623,7 @@ @@ -2786,7 +2786,7 @@ @@ -2949,7 +2949,7 @@ @@ -3112,7 +3112,7 @@ @@ -3282,7 +3282,7 @@ @@ -3453,7 +3453,7 @@ @@ -3591,7 +3591,7 @@ @@ -3679,7 +3679,7 @@ @@ -3756,9 +3756,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/HubLED.html b/docs/HubLED.html index 9b3e35f..a039a34 100644 --- a/docs/HubLED.html +++ b/docs/HubLED.html @@ -33,14 +33,14 @@ @@ -1396,9 +1396,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/LPF2Hub.html b/docs/LPF2Hub.html index 205f67f..08a842f 100644 --- a/docs/LPF2Hub.html +++ b/docs/LPF2Hub.html @@ -33,14 +33,14 @@ @@ -309,7 +309,7 @@ @@ -437,7 +437,7 @@ @@ -565,7 +565,7 @@ @@ -693,7 +693,7 @@ @@ -821,7 +821,7 @@ @@ -949,7 +949,7 @@ @@ -1077,7 +1077,7 @@ @@ -1205,7 +1205,7 @@ @@ -1333,7 +1333,7 @@ @@ -1958,7 +1958,7 @@ @@ -2035,9 +2035,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/Light.html b/docs/Light.html index bc73a9f..1e58a99 100644 --- a/docs/Light.html +++ b/docs/Light.html @@ -33,14 +33,14 @@ @@ -1396,9 +1396,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/Mario.html b/docs/Mario.html new file mode 100644 index 0000000..e4d7639 --- /dev/null +++ b/docs/Mario.html @@ -0,0 +1,2218 @@ + + + + + + + node-poweredup Class: Mario + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Mario

+
+ +
+ +

+ Mario +

+ + +
+ + +
+
+ + +
+
+

new Mario()

+ + +
+
+ + +
+

Mario is emitted if the discovered device is a LEGO Super Mario brick.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ +
+ +
+
+

<readonly> batteryLevel

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
batteryLevel + + +number + + + + +

Battery level of the hub (Percentage between 0-100)

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> firmwareVersion

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
firmwareVersion + + +string + + + + +

Firmware version of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> hardwareVersion

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hardwareVersion + + +string + + + + +

Hardware version of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> name

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

Name of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> ports

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ports + + +Array.<string> + + + + +

Array of port names

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> primaryMACAddress

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
primaryMACAddress + + +string + + + + +

Primary MAC address of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> rssi

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
rssi + + +number + + + + +

Signal strength of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> type

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +string + + + + +

Hub type

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> uuid

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
uuid + + +string + + + + +

UUID of the hub

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

createVirtualPort(firstPortName, secondPortName)

+ + +
+
+ + +
+

Combines two ports with into a single virtual port.

+

Note: The devices attached to the ports must be of the same device type.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
firstPortName + + +string + + + + +

First port name

secondPortName + + +string + + + + +

Second port name

+ + + + +
+ + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Resolved upon successful issuance of command.

+
+ + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

setName(name)

+ + +
+
+ + +
+

Set the name of the Hub.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

New name of the hub (14 characters or less, ASCII only).

+ + + + +
+ + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Resolved upon successful issuance of command.

+
+ + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ + + +
+
+

shutdown()

+ + +
+
+ + +
+

Shutdown the Hub.

+
+ + + + + + + + + + +
+ + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Resolved upon successful disconnect.

+
+ + + +
+
+ Type +
+
+ +Promise + + + +
+
+ + + + + +
+ +
+ + + + + +

Events

+ +
+ +
+
+

button

+ + +
+
+ + +
+

Emits when a button is pressed.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
button + + +string + + + + +
state + + +ButtonState + + + + +
+ + + + +
+ + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/MarioBarcodeSensor.html b/docs/MarioBarcodeSensor.html new file mode 100644 index 0000000..9017e72 --- /dev/null +++ b/docs/MarioBarcodeSensor.html @@ -0,0 +1,1456 @@ + + + + + + + node-poweredup Class: MarioBarcodeSensor + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: MarioBarcodeSensor

+
+ +
+ +

+ MarioBarcodeSensor +

+ + +
+ + +
+
+ + +
+
+

new MarioBarcodeSensor()

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ +
+ +
+
+

<readonly> connected

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connected + + +boolean + + + + +

Check if the device is still attached.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> hub

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hub + + +Hub + + + + +

The Hub the device is attached to.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> isVirtualPort

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
isVirtualPort + + +boolean + + + + +

Is this device attached to a virtual port (ie. a combined device)

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> mode

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mode + + +number + + + + +

The mode the device is currently in

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> portName

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
portName + + +string + + + + +

The port the device is attached to.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> type

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +number + + + + +

The type of the device

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + + + + + +

Events

+ +
+ +
+
+

barcode

+ + +
+
+ + +
+

Emits when the barcode sensor sees a barcode.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

rgb

+ + +
+
+ + +
+

Emits when the barcode sensor sees a RGB color.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
r + + +number + + + + +
g + + +number + + + + +
b + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/MarioPantsSensor.html b/docs/MarioPantsSensor.html new file mode 100644 index 0000000..b79d9b7 --- /dev/null +++ b/docs/MarioPantsSensor.html @@ -0,0 +1,1264 @@ + + + + + + + node-poweredup Class: MarioPantsSensor + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: MarioPantsSensor

+
+ +
+ +

+ MarioPantsSensor +

+ + +
+ + +
+
+ + +
+
+

new MarioPantsSensor()

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ +
+ +
+
+

<readonly> connected

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connected + + +boolean + + + + +

Check if the device is still attached.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> hub

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hub + + +Hub + + + + +

The Hub the device is attached to.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> isVirtualPort

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
isVirtualPort + + +boolean + + + + +

Is this device attached to a virtual port (ie. a combined device)

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> mode

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mode + + +number + + + + +

The mode the device is currently in

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> portName

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
portName + + +string + + + + +

The port the device is attached to.

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<readonly> type

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +number + + + + +

The type of the device

+
+ + + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + + + + + +

Events

+ +
+ +
+
+

pants

+ + +
+
+ + +
+

Emits when the user changes the pants on Mario.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pants + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/MediumLinearMotor.html b/docs/MediumLinearMotor.html index 43f58b3..958a5ff 100644 --- a/docs/MediumLinearMotor.html +++ b/docs/MediumLinearMotor.html @@ -33,14 +33,14 @@ @@ -1469,9 +1469,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/MotionSensor.html b/docs/MotionSensor.html index 52257b1..5f01721 100644 --- a/docs/MotionSensor.html +++ b/docs/MotionSensor.html @@ -33,14 +33,14 @@ @@ -1168,9 +1168,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/MoveHub.html b/docs/MoveHub.html index fb213b6..e3ddca8 100644 --- a/docs/MoveHub.html +++ b/docs/MoveHub.html @@ -33,14 +33,14 @@ @@ -320,7 +320,7 @@ @@ -453,7 +453,7 @@ @@ -586,7 +586,7 @@ @@ -719,7 +719,7 @@ @@ -852,7 +852,7 @@ @@ -985,7 +985,7 @@ @@ -1118,7 +1118,7 @@ @@ -1251,7 +1251,7 @@ @@ -1384,7 +1384,7 @@ @@ -2045,7 +2045,7 @@ @@ -2122,9 +2122,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/MoveHubMediumLinearMotor.html b/docs/MoveHubMediumLinearMotor.html index 5d78beb..5438fd9 100644 --- a/docs/MoveHubMediumLinearMotor.html +++ b/docs/MoveHubMediumLinearMotor.html @@ -33,14 +33,14 @@ @@ -1469,9 +1469,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/MoveHubTiltSensor.html b/docs/MoveHubTiltSensor.html index fdd011c..b73ca8a 100644 --- a/docs/MoveHubTiltSensor.html +++ b/docs/MoveHubTiltSensor.html @@ -33,14 +33,14 @@ @@ -1192,9 +1192,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/PUPHub.html b/docs/PUPHub.html index 3bbe2cd..0c3f8d7 100644 --- a/docs/PUPHub.html +++ b/docs/PUPHub.html @@ -33,14 +33,14 @@ @@ -320,7 +320,7 @@ @@ -453,7 +453,7 @@ @@ -586,7 +586,7 @@ @@ -719,7 +719,7 @@ @@ -852,7 +852,7 @@ @@ -985,7 +985,7 @@ @@ -1118,7 +1118,7 @@ @@ -1251,7 +1251,7 @@ @@ -1384,7 +1384,7 @@ @@ -1480,7 +1480,7 @@ @@ -1802,7 +1802,7 @@ @@ -1973,7 +1973,7 @@ @@ -2097,7 +2097,7 @@ @@ -2268,7 +2268,7 @@ @@ -2742,7 +2742,7 @@ @@ -2914,7 +2914,7 @@ @@ -3086,7 +3086,7 @@ @@ -3258,7 +3258,7 @@ @@ -3437,7 +3437,7 @@ @@ -3613,7 +3613,7 @@ @@ -3760,7 +3760,7 @@ @@ -3857,7 +3857,7 @@ @@ -3934,9 +3934,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/PUPRemote.html b/docs/PUPRemote.html index dca60fc..38f4517 100644 --- a/docs/PUPRemote.html +++ b/docs/PUPRemote.html @@ -33,14 +33,14 @@ @@ -320,7 +320,7 @@ @@ -453,7 +453,7 @@ @@ -586,7 +586,7 @@ @@ -719,7 +719,7 @@ @@ -852,7 +852,7 @@ @@ -985,7 +985,7 @@ @@ -1118,7 +1118,7 @@ @@ -1251,7 +1251,7 @@ @@ -1384,7 +1384,7 @@ @@ -1480,7 +1480,7 @@ @@ -1802,7 +1802,7 @@ @@ -1973,7 +1973,7 @@ @@ -2097,7 +2097,7 @@ @@ -2268,7 +2268,7 @@ @@ -2742,7 +2742,7 @@ @@ -2914,7 +2914,7 @@ @@ -3086,7 +3086,7 @@ @@ -3258,7 +3258,7 @@ @@ -3437,7 +3437,7 @@ @@ -3613,7 +3613,7 @@ @@ -3760,7 +3760,7 @@ @@ -3857,7 +3857,7 @@ @@ -3934,9 +3934,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/PiezoBuzzer.html b/docs/PiezoBuzzer.html index 1258e3d..7361a9c 100644 --- a/docs/PiezoBuzzer.html +++ b/docs/PiezoBuzzer.html @@ -33,14 +33,14 @@ @@ -1210,9 +1210,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/RemoteControl.html b/docs/RemoteControl.html index 357a77e..3d8e467 100644 --- a/docs/RemoteControl.html +++ b/docs/RemoteControl.html @@ -33,14 +33,14 @@ @@ -320,7 +320,7 @@ @@ -453,7 +453,7 @@ @@ -586,7 +586,7 @@ @@ -719,7 +719,7 @@ @@ -852,7 +852,7 @@ @@ -985,7 +985,7 @@ @@ -1118,7 +1118,7 @@ @@ -1251,7 +1251,7 @@ @@ -1384,7 +1384,7 @@ @@ -2045,7 +2045,7 @@ @@ -2122,9 +2122,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/RemoteControlButton.html b/docs/RemoteControlButton.html index 3a1485b..99ec5ec 100644 --- a/docs/RemoteControlButton.html +++ b/docs/RemoteControlButton.html @@ -33,14 +33,14 @@ @@ -1168,9 +1168,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/SimpleMediumLinearMotor.html b/docs/SimpleMediumLinearMotor.html index 3ee42f1..5e8ce04 100644 --- a/docs/SimpleMediumLinearMotor.html +++ b/docs/SimpleMediumLinearMotor.html @@ -33,14 +33,14 @@ @@ -1020,9 +1020,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TachoMotor.html b/docs/TachoMotor.html index fce5ea1..18e453d 100644 --- a/docs/TachoMotor.html +++ b/docs/TachoMotor.html @@ -33,14 +33,14 @@ @@ -2810,9 +2810,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicColorSensor.html b/docs/TechnicColorSensor.html index 62fa04e..d346460 100644 --- a/docs/TechnicColorSensor.html +++ b/docs/TechnicColorSensor.html @@ -33,14 +33,14 @@ @@ -1670,9 +1670,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicDistanceSensor.html b/docs/TechnicDistanceSensor.html index d750d6d..d2b01e4 100644 --- a/docs/TechnicDistanceSensor.html +++ b/docs/TechnicDistanceSensor.html @@ -33,14 +33,14 @@ @@ -1550,9 +1550,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicForceSensor.html b/docs/TechnicForceSensor.html index acbd13d..0ec4fae 100644 --- a/docs/TechnicForceSensor.html +++ b/docs/TechnicForceSensor.html @@ -33,14 +33,14 @@ @@ -1456,9 +1456,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicLargeAngularMotor.html b/docs/TechnicLargeAngularMotor.html index c9ec0ef..55f617c 100644 --- a/docs/TechnicLargeAngularMotor.html +++ b/docs/TechnicLargeAngularMotor.html @@ -33,14 +33,14 @@ @@ -2162,9 +2162,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicLargeLinearMotor.html b/docs/TechnicLargeLinearMotor.html index 50f1302..a053d14 100644 --- a/docs/TechnicLargeLinearMotor.html +++ b/docs/TechnicLargeLinearMotor.html @@ -33,14 +33,14 @@ @@ -2162,9 +2162,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicMediumAngularMotor.html b/docs/TechnicMediumAngularMotor.html index c7ef65e..8aab33a 100644 --- a/docs/TechnicMediumAngularMotor.html +++ b/docs/TechnicMediumAngularMotor.html @@ -33,14 +33,14 @@ @@ -2162,9 +2162,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicMediumHub.html b/docs/TechnicMediumHub.html index aa3692f..8b30a83 100644 --- a/docs/TechnicMediumHub.html +++ b/docs/TechnicMediumHub.html @@ -33,14 +33,14 @@ @@ -320,7 +320,7 @@ @@ -453,7 +453,7 @@ @@ -586,7 +586,7 @@ @@ -719,7 +719,7 @@ @@ -852,7 +852,7 @@ @@ -985,7 +985,7 @@ @@ -1118,7 +1118,7 @@ @@ -1251,7 +1251,7 @@ @@ -1384,7 +1384,7 @@ @@ -2045,7 +2045,7 @@ @@ -2122,9 +2122,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicMediumHubAccelerometerSensor.html b/docs/TechnicMediumHubAccelerometerSensor.html index 04afc78..3de8f3f 100644 --- a/docs/TechnicMediumHubAccelerometerSensor.html +++ b/docs/TechnicMediumHubAccelerometerSensor.html @@ -33,14 +33,14 @@ @@ -1216,9 +1216,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicMediumHubGyroSensor.html b/docs/TechnicMediumHubGyroSensor.html index ecef770..e93ec11 100644 --- a/docs/TechnicMediumHubGyroSensor.html +++ b/docs/TechnicMediumHubGyroSensor.html @@ -33,14 +33,14 @@ @@ -1216,9 +1216,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicMediumHubTiltSensor.html b/docs/TechnicMediumHubTiltSensor.html index 6ad51d1..96713a0 100644 --- a/docs/TechnicMediumHubTiltSensor.html +++ b/docs/TechnicMediumHubTiltSensor.html @@ -33,14 +33,14 @@ @@ -1216,9 +1216,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TechnicXLargeLinearMotor.html b/docs/TechnicXLargeLinearMotor.html index 72e6450..fdf6d6e 100644 --- a/docs/TechnicXLargeLinearMotor.html +++ b/docs/TechnicXLargeLinearMotor.html @@ -33,14 +33,14 @@ @@ -2162,9 +2162,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TiltSensor.html b/docs/TiltSensor.html index f208cf8..44f0ad7 100644 --- a/docs/TiltSensor.html +++ b/docs/TiltSensor.html @@ -33,14 +33,14 @@ @@ -1192,9 +1192,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/TrainMotor.html b/docs/TrainMotor.html index 3082381..a1e1f1f 100644 --- a/docs/TrainMotor.html +++ b/docs/TrainMotor.html @@ -33,14 +33,14 @@ @@ -1656,9 +1656,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/VoltageSensor.html b/docs/VoltageSensor.html index a2344de..d5fe3a9 100644 --- a/docs/VoltageSensor.html +++ b/docs/VoltageSensor.html @@ -33,14 +33,14 @@ @@ -1168,9 +1168,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/WeDo2SmartHub.html b/docs/WeDo2SmartHub.html index a1e097f..985d3ff 100644 --- a/docs/WeDo2SmartHub.html +++ b/docs/WeDo2SmartHub.html @@ -33,14 +33,14 @@ @@ -313,7 +313,7 @@ @@ -441,7 +441,7 @@ @@ -569,7 +569,7 @@ @@ -697,7 +697,7 @@ @@ -825,7 +825,7 @@ @@ -953,7 +953,7 @@ @@ -1081,7 +1081,7 @@ @@ -1209,7 +1209,7 @@ @@ -1337,7 +1337,7 @@ @@ -1852,9 +1852,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/classes.list.html b/docs/classes.list.html index dd6c6ad..df30c76 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -33,14 +33,14 @@ @@ -193,6 +193,15 @@
LPF2Hub
+
Mario
+
+ +
MarioBarcodeSensor
+
+ +
MarioPantsSensor
+
+
MediumLinearMotor
@@ -704,7 +713,7 @@ @@ -875,7 +884,7 @@ @@ -1022,7 +1031,7 @@ @@ -1119,7 +1128,7 @@ @@ -1431,7 +1440,7 @@ @@ -1575,7 +1584,7 @@ @@ -1722,7 +1731,7 @@ @@ -1893,7 +1902,7 @@ @@ -2040,7 +2049,7 @@ @@ -2137,7 +2146,7 @@ @@ -2452,7 +2461,7 @@ @@ -3214,7 +3223,7 @@ @@ -3385,7 +3394,7 @@ @@ -3523,7 +3532,7 @@ @@ -3611,7 +3620,7 @@ @@ -3773,7 +3782,658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

button

+ + +
+
+ + +
+

Emits when a button is pressed.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
button + + +string + + + + +
state + + +ButtonState + + + + +
+ + + + +
+ + + + + + + +
Inherited From:
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

barcode

+ + +
+
+ + +
+

Emits when the barcode sensor sees a barcode.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

rgb

+ + +
+
+ + +
+

Emits when the barcode sensor sees a RGB color.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
r + + +number + + + + +
g + + +number + + + + +
b + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

pants

+ + +
+
+ + +
+

Emits when the user changes the pants on Mario.

+
+ + + + + +
Type: +object + + +
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pants + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+
@@ -4241,7 +4901,7 @@
@@ -4709,7 +5369,7 @@ @@ -4885,7 +5545,7 @@ @@ -5032,7 +5692,7 @@ @@ -5129,7 +5789,7 @@ @@ -5276,7 +5936,7 @@ @@ -5452,7 +6112,7 @@ @@ -5599,7 +6259,7 @@ @@ -5696,7 +6356,7 @@ @@ -5867,7 +6527,7 @@ @@ -8396,7 +9056,7 @@ @@ -9829,9 +10489,9 @@ - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_absolutemotor.js.html b/docs/devices_absolutemotor.js.html index d9a459d..fd07473 100644 --- a/docs/devices_absolutemotor.js.html +++ b/docs/devices_absolutemotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -261,9 +261,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_basicmotor.js.html b/docs/devices_basicmotor.js.html index 0e9a754..e0cd2f4 100644 --- a/docs/devices_basicmotor.js.html +++ b/docs/devices_basicmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -203,9 +203,9 @@ exports.BasicMotor = BasicMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_colordistancesensor.js.html b/docs/devices_colordistancesensor.js.html index c3d16fb..eceae40 100644 --- a/docs/devices_colordistancesensor.js.html +++ b/docs/devices_colordistancesensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -129,7 +129,10 @@ class ColorDistanceSensor extends device_1.Device { break; } if (message[4] <= 10) { - const distance = Math.floor(message[4] * 25.4) - 20; + let distance = Math.floor(message[4] * 25.4); + if (distance < 0) { + distance = 0; + } /** * Emits when a distance sensor is activated. * @event ColorDistanceSensor#distance @@ -250,7 +253,7 @@ class ColorDistanceSensor extends device_1.Device { * @returns {Promise} Resolved upon successful issuance of the command. */ setColor(color) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { if (color === false) { color = 0; } @@ -330,9 +333,9 @@ var Output; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_currentsensor.js.html b/docs/devices_currentsensor.js.html index 482f7ba..b8c989a 100644 --- a/docs/devices_currentsensor.js.html +++ b/docs/devices_currentsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -197,9 +197,9 @@ const MaxCurrentRaw = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_device.js.html b/docs/devices_device.js.html index a77d956..9603667 100644 --- a/docs/devices_device.js.html +++ b/docs/devices_device.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -299,9 +299,9 @@ exports.Device = Device; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_duplotrainbasecolorsensor.js.html b/docs/devices_duplotrainbasecolorsensor.js.html index c8d11fd..bfb9ba9 100644 --- a/docs/devices_duplotrainbasecolorsensor.js.html +++ b/docs/devices_duplotrainbasecolorsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -206,9 +206,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_duplotrainbasemotor.js.html b/docs/devices_duplotrainbasemotor.js.html index 67e7d83..838a04f 100644 --- a/docs/devices_duplotrainbasemotor.js.html +++ b/docs/devices_duplotrainbasemotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.DuploTrainBaseMotor = DuploTrainBaseMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_duplotrainbasespeaker.js.html b/docs/devices_duplotrainbasespeaker.js.html index 322fb91..3697bd3 100644 --- a/docs/devices_duplotrainbasespeaker.js.html +++ b/docs/devices_duplotrainbasespeaker.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -116,7 +116,7 @@ class DuploTrainBaseSpeaker extends device_1.Device { * @returns {Promise} Resolved upon successful issuance of the command. */ playSound(sound) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { this.subscribe(Mode.SOUND); this.writeDirect(0x01, Buffer.from([sound])); return resolve(); @@ -182,9 +182,9 @@ var Mode; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_duplotrainbasespeedometer.js.html b/docs/devices_duplotrainbasespeedometer.js.html index 6615d9d..8caaa52 100644 --- a/docs/devices_duplotrainbasespeedometer.js.html +++ b/docs/devices_duplotrainbasespeedometer.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -176,9 +176,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_hubled.js.html b/docs/devices_hubled.js.html index 949f8c4..e6c3a3b 100644 --- a/docs/devices_hubled.js.html +++ b/docs/devices_hubled.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -116,7 +116,7 @@ class HubLED extends device_1.Device { * @returns {Promise} Resolved upon successful issuance of the command. */ setColor(color) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { if (typeof color === "boolean") { color = 0; } @@ -140,7 +140,7 @@ class HubLED extends device_1.Device { * @returns {Promise} Resolved upon successful issuance of the command. */ setRGB(red, green, blue) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { if (this.isWeDo2SmartHub) { this.send(Buffer.from([0x06, 0x17, 0x01, 0x02]), Consts.BLECharacteristic.WEDO2_PORT_TYPE_WRITE); this.send(Buffer.from([0x06, 0x04, 0x03, red, green, blue]), Consts.BLECharacteristic.WEDO2_MOTOR_VALUE_WRITE); @@ -202,9 +202,9 @@ var Mode; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_light.js.html b/docs/devices_light.js.html index a37fb00..069efe6 100644 --- a/docs/devices_light.js.html +++ b/docs/devices_light.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -188,9 +188,9 @@ exports.Light = Light; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_mariobarcodesensor.js.html b/docs/devices_mariobarcodesensor.js.html new file mode 100644 index 0000000..2605b97 --- /dev/null +++ b/docs/devices_mariobarcodesensor.js.html @@ -0,0 +1,296 @@ + + + + + + + node-poweredup Source: devices/mariobarcodesensor.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: devices/mariobarcodesensor.js

+ +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ModeMap = exports.Mode = exports.MarioBarcodeSensor = void 0;
+const device_1 = require("./device");
+const Consts = __importStar(require("../consts"));
+/**
+ * @class MarioBarcodeSensor
+ * @extends Device
+ */
+class MarioBarcodeSensor extends device_1.Device {
+    constructor(hub, portId) {
+        super(hub, portId, exports.ModeMap, Consts.DeviceType.MARIO_BARCODE_SENSOR);
+    }
+    receive(message) {
+        const mode = this._mode;
+        switch (mode) {
+            case Mode.BARCODE:
+                /**
+                 * Emits when the barcode sensor sees a barcode.
+                 * @event MarioBarcodeSensor#barcode
+                 * @type {object}
+                 * @param {number} id
+                 */
+                const barcode = message.readUInt16LE(4);
+                const color = message.readUInt16LE(6);
+                if (color === 0xffff) {
+                    // This is a barcode
+                    this.notify("barcode", { barcode });
+                }
+                else if (barcode === 0xffff) {
+                    // This is a color
+                    this.notify("barcode", { color });
+                }
+                break;
+            case Mode.RGB:
+                /**
+                 * Emits when the barcode sensor sees a RGB color.
+                 * @event MarioBarcodeSensor#rgb
+                 * @type {object}
+                 * @param {number} r
+                 * @param {number} g
+                 * @param {number} b
+                 */
+                const r = message[4];
+                const g = message[5];
+                const b = message[6];
+                this.notify("rgb", { r, g, b });
+                break;
+        }
+    }
+}
+exports.MarioBarcodeSensor = MarioBarcodeSensor;
+var Mode;
+(function (Mode) {
+    Mode[Mode["BARCODE"] = 0] = "BARCODE";
+    Mode[Mode["RGB"] = 1] = "RGB";
+})(Mode = exports.Mode || (exports.Mode = {}));
+exports.ModeMap = {
+    "barcode": Mode.BARCODE,
+    "rgb": Mode.RGB,
+};
+//# sourceMappingURL=mariobarcodesensor.js.map
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/devices_mariopantssensor.js.html b/docs/devices_mariopantssensor.js.html new file mode 100644 index 0000000..a3b2c01 --- /dev/null +++ b/docs/devices_mariopantssensor.js.html @@ -0,0 +1,272 @@ + + + + + + + node-poweredup Source: devices/mariopantssensor.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: devices/mariopantssensor.js

+ +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ModeMap = exports.Mode = exports.MarioPantsSensor = void 0;
+const device_1 = require("./device");
+const Consts = __importStar(require("../consts"));
+/**
+ * @class MarioPantsSensor
+ * @extends Device
+ */
+class MarioPantsSensor extends device_1.Device {
+    constructor(hub, portId) {
+        super(hub, portId, exports.ModeMap, Consts.DeviceType.MARIO_PANTS_SENSOR);
+    }
+    receive(message) {
+        const mode = this._mode;
+        switch (mode) {
+            case Mode.PANTS:
+                /**
+                 * Emits when the user changes the pants on Mario.
+                 * @event MarioPantsSensor#pants
+                 * @type {object}
+                 * @param {number} pants
+                 */
+                const pants = message[4];
+                this.notify("pants", { pants });
+                break;
+        }
+    }
+}
+exports.MarioPantsSensor = MarioPantsSensor;
+var Mode;
+(function (Mode) {
+    Mode[Mode["PANTS"] = 0] = "PANTS";
+})(Mode = exports.Mode || (exports.Mode = {}));
+exports.ModeMap = {
+    "pants": Mode.PANTS,
+};
+//# sourceMappingURL=mariopantssensor.js.map
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/devices_mediumlinearmotor.js.html b/docs/devices_mediumlinearmotor.js.html index c75e78e..2848fad 100644 --- a/docs/devices_mediumlinearmotor.js.html +++ b/docs/devices_mediumlinearmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.MediumLinearMotor = MediumLinearMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_motionsensor.js.html b/docs/devices_motionsensor.js.html index 5c6b131..c7bab56 100644 --- a/docs/devices_motionsensor.js.html +++ b/docs/devices_motionsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -180,9 +180,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_movehubmediumlinearmotor.js.html b/docs/devices_movehubmediumlinearmotor.js.html index ea5d0ba..e816afd 100644 --- a/docs/devices_movehubmediumlinearmotor.js.html +++ b/docs/devices_movehubmediumlinearmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.MoveHubMediumLinearMotor = MoveHubMediumLinearMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_movehubtiltsensor.js.html b/docs/devices_movehubtiltsensor.js.html index 96d3dc3..7164e35 100644 --- a/docs/devices_movehubtiltsensor.js.html +++ b/docs/devices_movehubtiltsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -178,9 +178,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_piezobuzzer.js.html b/docs/devices_piezobuzzer.js.html index f8f74e5..8ad3d2d 100644 --- a/docs/devices_piezobuzzer.js.html +++ b/docs/devices_piezobuzzer.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -170,9 +170,9 @@ exports.PiezoBuzzer = PiezoBuzzer; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_remotecontrolbutton.js.html b/docs/devices_remotecontrolbutton.js.html index 1216373..e3d6fad 100644 --- a/docs/devices_remotecontrolbutton.js.html +++ b/docs/devices_remotecontrolbutton.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -182,9 +182,9 @@ exports.ButtonState = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_simplemediumlinearmotor.js.html b/docs/devices_simplemediumlinearmotor.js.html index 8b1f639..de9f261 100644 --- a/docs/devices_simplemediumlinearmotor.js.html +++ b/docs/devices_simplemediumlinearmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.SimpleMediumLinearMotor = SimpleMediumLinearMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_tachomotor.js.html b/docs/devices_tachomotor.js.html index b2c7182..61b66f3 100644 --- a/docs/devices_tachomotor.js.html +++ b/docs/devices_tachomotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -311,9 +311,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_techniccolorsensor.js.html b/docs/devices_techniccolorsensor.js.html index 9c7515e..4c1c0c7 100644 --- a/docs/devices_techniccolorsensor.js.html +++ b/docs/devices_techniccolorsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -213,9 +213,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicdistancesensor.js.html b/docs/devices_technicdistancesensor.js.html index d2df545..79c3f99 100644 --- a/docs/devices_technicdistancesensor.js.html +++ b/docs/devices_technicdistancesensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -200,9 +200,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicforcesensor.js.html b/docs/devices_technicforcesensor.js.html index f7d85a7..add4968 100644 --- a/docs/devices_technicforcesensor.js.html +++ b/docs/devices_technicforcesensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -113,7 +113,7 @@ class TechnicForceSensor extends device_1.Device { const mode = this._mode; switch (mode) { case Mode.FORCE: - const force = message[4] / 10; + const force = message[this.isWeDo2SmartHub ? 2 : 4] / 10; /** * Emits when force is applied. * @event TechnicForceSensor#force @@ -200,9 +200,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_techniclargeangularmotor.js.html b/docs/devices_techniclargeangularmotor.js.html index 592500d..40858b5 100644 --- a/docs/devices_techniclargeangularmotor.js.html +++ b/docs/devices_techniclargeangularmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -106,8 +106,8 @@ const Consts = __importStar(require("../consts")); * @extends AbsoluteMotor */ class TechnicLargeAngularMotor extends absolutemotor_1.AbsoluteMotor { - constructor(hub, portId) { - super(hub, portId, {}, Consts.DeviceType.TECHNIC_LARGE_ANGULAR_MOTOR); + constructor(hub, portId, modeMap = {}, type = Consts.DeviceType.TECHNIC_LARGE_ANGULAR_MOTOR) { + super(hub, portId, {}, type); } } exports.TechnicLargeAngularMotor = TechnicLargeAngularMotor; @@ -154,9 +154,9 @@ exports.TechnicLargeAngularMotor = TechnicLargeAngularMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_techniclargelinearmotor.js.html b/docs/devices_techniclargelinearmotor.js.html index 19e1323..3f14453 100644 --- a/docs/devices_techniclargelinearmotor.js.html +++ b/docs/devices_techniclargelinearmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.TechnicLargeLinearMotor = TechnicLargeLinearMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicmediumangularmotor.js.html b/docs/devices_technicmediumangularmotor.js.html index 70a0ace..f4d0408 100644 --- a/docs/devices_technicmediumangularmotor.js.html +++ b/docs/devices_technicmediumangularmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -106,8 +106,8 @@ const Consts = __importStar(require("../consts")); * @extends AbsoluteMotor */ class TechnicMediumAngularMotor extends absolutemotor_1.AbsoluteMotor { - constructor(hub, portId) { - super(hub, portId, {}, Consts.DeviceType.TECHNIC_MEDIUM_ANGULAR_MOTOR); + constructor(hub, portId, modeMap = {}, type = Consts.DeviceType.TECHNIC_MEDIUM_ANGULAR_MOTOR) { + super(hub, portId, {}, type); } } exports.TechnicMediumAngularMotor = TechnicMediumAngularMotor; @@ -154,9 +154,9 @@ exports.TechnicMediumAngularMotor = TechnicMediumAngularMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicmediumhubaccelerometersensor.js.html b/docs/devices_technicmediumhubaccelerometersensor.js.html index 0221bed..f0a6639 100644 --- a/docs/devices_technicmediumhubaccelerometersensor.js.html +++ b/docs/devices_technicmediumhubaccelerometersensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -180,9 +180,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicmediumhubgyrosensor.js.html b/docs/devices_technicmediumhubgyrosensor.js.html index 8a519b3..72fd107 100644 --- a/docs/devices_technicmediumhubgyrosensor.js.html +++ b/docs/devices_technicmediumhubgyrosensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -180,9 +180,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicmediumhubtiltsensor.js.html b/docs/devices_technicmediumhubtiltsensor.js.html index 94ad155..93cad77 100644 --- a/docs/devices_technicmediumhubtiltsensor.js.html +++ b/docs/devices_technicmediumhubtiltsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -180,9 +180,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_technicxlargelinearmotor.js.html b/docs/devices_technicxlargelinearmotor.js.html index e88fd19..5c59c0b 100644 --- a/docs/devices_technicxlargelinearmotor.js.html +++ b/docs/devices_technicxlargelinearmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.TechnicXLargeLinearMotor = TechnicXLargeLinearMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_tiltsensor.js.html b/docs/devices_tiltsensor.js.html index 79a5463..adf0516 100644 --- a/docs/devices_tiltsensor.js.html +++ b/docs/devices_tiltsensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -178,9 +178,9 @@ exports.ModeMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_trainmotor.js.html b/docs/devices_trainmotor.js.html index c7910de..f68d456 100644 --- a/docs/devices_trainmotor.js.html +++ b/docs/devices_trainmotor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -154,9 +154,9 @@ exports.TrainMotor = TrainMotor; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/devices_voltagesensor.js.html b/docs/devices_voltagesensor.js.html index 685f20b..5189233 100644 --- a/docs/devices_voltagesensor.js.html +++ b/docs/devices_voltagesensor.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -201,9 +201,9 @@ const MaxVoltageRaw = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_basehub.js.html b/docs/hubs_basehub.js.html index 3255c6a..b0c958c 100644 --- a/docs/hubs_basehub.js.html +++ b/docs/hubs_basehub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -109,6 +109,8 @@ const duplotrainbasespeaker_1 = require("../devices/duplotrainbasespeaker"); const duplotrainbasespeedometer_1 = require("../devices/duplotrainbasespeedometer"); const hubled_1 = require("../devices/hubled"); const light_1 = require("../devices/light"); +const mariobarcodesensor_1 = require("../devices/mariobarcodesensor"); +const mariopantssensor_1 = require("../devices/mariopantssensor"); const mediumlinearmotor_1 = require("../devices/mediumlinearmotor"); const motionsensor_1 = require("../devices/motionsensor"); const movehubmediumlinearmotor_1 = require("../devices/movehubmediumlinearmotor"); @@ -450,11 +452,13 @@ class BaseHub extends events_1.EventEmitter { [Consts.DeviceType.DUPLO_TRAIN_BASE_COLOR_SENSOR]: duplotrainbasecolorsensor_1.DuploTrainBaseColorSensor, [Consts.DeviceType.DUPLO_TRAIN_BASE_MOTOR]: duplotrainbasemotor_1.DuploTrainBaseMotor, [Consts.DeviceType.DUPLO_TRAIN_BASE_SPEAKER]: duplotrainbasespeaker_1.DuploTrainBaseSpeaker, - [Consts.DeviceType.DUPLO_TRAIN_BASE_SPEEDOMETER]: duplotrainbasespeedometer_1.DuploTrainBaseSpeedometer + [Consts.DeviceType.DUPLO_TRAIN_BASE_SPEEDOMETER]: duplotrainbasespeedometer_1.DuploTrainBaseSpeedometer, + [Consts.DeviceType.MARIO_BARCODE_SENSOR]: mariobarcodesensor_1.MarioBarcodeSensor, + [Consts.DeviceType.MARIO_PANTS_SENSOR]: mariopantssensor_1.MarioPantsSensor, }; constructor = deviceConstructors[deviceType]; if (constructor) { - return new constructor(this, portId); + return new constructor(this, portId, undefined, deviceType); } else { return new device_1.Device(this, portId, undefined, deviceType); @@ -508,9 +512,9 @@ exports.BaseHub = BaseHub; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_boostmovehub.js.html b/docs/hubs_boostmovehub.js.html index 51af81a..06a1d81 100644 --- a/docs/hubs_boostmovehub.js.html +++ b/docs/hubs_boostmovehub.js.html @@ -33,14 +33,14 @@ @@ -180,9 +180,9 @@ exports.BoostMoveHub = BoostMoveHub; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_controlplushub.js.html b/docs/hubs_controlplushub.js.html index 29c2531..0d5d00d 100644 --- a/docs/hubs_controlplushub.js.html +++ b/docs/hubs_controlplushub.js.html @@ -33,14 +33,14 @@ @@ -177,9 +177,9 @@ exports.ControlPlusHub = ControlPlusHub; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_duplotrainbase.js.html b/docs/hubs_duplotrainbase.js.html index 1abf123..acef827 100644 --- a/docs/hubs_duplotrainbase.js.html +++ b/docs/hubs_duplotrainbase.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -177,9 +177,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_hub.js.html b/docs/hubs_hub.js.html index de35963..13a18d5 100644 --- a/docs/hubs_hub.js.html +++ b/docs/hubs_hub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -189,9 +189,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_lpf2hub.js.html b/docs/hubs_lpf2hub.js.html index f9e6ef7..3f14eb3 100644 --- a/docs/hubs_lpf2hub.js.html +++ b/docs/hubs_lpf2hub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -120,12 +120,12 @@ class LPF2Hub extends basehub_1.BaseHub { await super.connect(); await this._bleDevice.discoverCharacteristicsForService(Consts.BLEService.LPF2_HUB); this._bleDevice.subscribeToCharacteristic(Consts.BLECharacteristic.LPF2_ALL, this._parseMessage.bind(this)); - await this._requestHubPropertyReports(0x02); // Activate button reports - await this._requestHubPropertyValue(0x03); // Request firmware version - await this._requestHubPropertyValue(0x04); // Request hardware version - await this._requestHubPropertyReports(0x05); // Activate RSSI updates - await this._requestHubPropertyReports(0x06); // Activate battery level reports - await this._requestHubPropertyValue(0x0d); // Request primary MAC address + await this._requestHubPropertyReports(Consts.HubPropertyPayload.BUTTON_STATE); + await this._requestHubPropertyValue(Consts.HubPropertyPayload.FW_VERSION); + await this._requestHubPropertyValue(Consts.HubPropertyPayload.HW_VERSION); + await this._requestHubPropertyReports(Consts.HubPropertyPayload.RSSI); + await this._requestHubPropertyReports(Consts.HubPropertyPayload.BATTERY_VOLTAGE); + await this._requestHubPropertyValue(Consts.HubPropertyPayload.PRIMARY_MAC_ADDRESS); this.emit("connect"); debug("LPF2Hub connected"); } @@ -200,12 +200,12 @@ class LPF2Hub extends basehub_1.BaseHub { return; } const len = this._messageBuffer[0]; - if (len >= this._messageBuffer.length) { + if (len <= this._messageBuffer.length) { const message = this._messageBuffer.slice(0, len); this._messageBuffer = this._messageBuffer.slice(len); debug("Received Message (LPF2_ALL)", message); switch (message[2]) { - case 0x01: { + case Consts.MessageType.HUB_PROPERTIES: { const property = message[3]; const callback = this._propertyRequestCallbacks[property]; if (callback) { @@ -217,23 +217,23 @@ class LPF2Hub extends basehub_1.BaseHub { delete this._propertyRequestCallbacks[property]; break; } - case 0x04: { + case Consts.MessageType.HUB_ATTACHED_IO: { this._parsePortMessage(message); break; } - case 0x43: { + case Consts.MessageType.PORT_INFORMATION: { this._parsePortInformationResponse(message); break; } - case 0x44: { + case Consts.MessageType.PORT_MODE_INFORMATION: { this._parseModeInformationResponse(message); break; } - case 0x45: { + case Consts.MessageType.PORT_VALUE_SINGLE: { this._parseSensorMessage(message); break; } - case 0x82: { + case Consts.MessageType.HUB_ACTIONS: { this._parsePortAction(message); break; } @@ -256,8 +256,7 @@ class LPF2Hub extends basehub_1.BaseHub { return this.send(Buffer.from([0x01, property, 0x02]), Consts.BLECharacteristic.LPF2_ALL); } _parseHubPropertyResponse(message) { - // Button press reports - if (message[3] === 0x02) { + if (message[3] === Consts.HubPropertyPayload.BUTTON_STATE) { if (message[5] === 1) { /** * Emits when a button is pressed. @@ -272,30 +271,25 @@ class LPF2Hub extends basehub_1.BaseHub { this.emit("button", { event: Consts.ButtonState.RELEASED }); return; } - // Firmware version } - else if (message[3] === 0x03) { + else if (message[3] === Consts.HubPropertyPayload.FW_VERSION) { this._firmwareVersion = utils_1.decodeVersion(message.readInt32LE(5)); this._checkFirmware(this._firmwareVersion); - // Hardware version } - else if (message[3] === 0x04) { + else if (message[3] === Consts.HubPropertyPayload.HW_VERSION) { this._hardwareVersion = utils_1.decodeVersion(message.readInt32LE(5)); - // RSSI update } - else if (message[3] === 0x05) { + else if (message[3] === Consts.HubPropertyPayload.RSSI) { const rssi = message.readInt8(5); if (rssi !== 0) { this._rssi = rssi; this.emit("rssi", { rssi: this._rssi }); } - // primary MAC Address } - else if (message[3] === 0x0d) { + else if (message[3] === Consts.HubPropertyPayload.PRIMARY_MAC_ADDRESS) { this._primaryMACAddress = utils_1.decodeMACAddress(message.slice(5)); - // Battery level reports } - else if (message[3] === 0x06) { + else if (message[3] === Consts.HubPropertyPayload.BATTERY_VOLTAGE) { const batteryLevel = message[5]; if (batteryLevel !== this._batteryLevel) { this._batteryLevel = batteryLevel; @@ -307,8 +301,7 @@ class LPF2Hub extends basehub_1.BaseHub { const portId = message[3]; const event = message[4]; const deviceType = event ? message.readUInt16LE(5) : 0; - // Handle device attachments - if (event === 0x01) { + if (event === Consts.AlertPayload.ATTACHED_IO) { if (modeInfoDebug.enabled) { const deviceTypeName = Consts.DeviceTypeNames[message[5]] || "Unknown"; modeInfoDebug(`Port ${utils_1.toHex(portId)}, type ${utils_1.toHex(deviceType, 4)} (${deviceTypeName})`); @@ -319,9 +312,8 @@ class LPF2Hub extends basehub_1.BaseHub { } const device = this._createDevice(deviceType, portId); this._attachDevice(device); - // Handle device detachments } - else if (event === 0x00) { + else if (event === Consts.AlertPayload.DETACHED_IO) { const device = this._getDeviceByPortId(portId); if (device) { this._detachDevice(device); @@ -333,9 +325,8 @@ class LPF2Hub extends basehub_1.BaseHub { this._virtualPorts = this._virtualPorts.filter((virtualPortId) => virtualPortId !== portId); } } - // Handle virtual port creation } - else if (event === 0x02) { + else if (event === Consts.AlertPayload.ATTACHED_VIRTUAL_IO) { const firstPortName = this.getPortNameForPortId(message[7]); const secondPortName = this.getPortNameForPortId(message[8]); // @ts-ignore NK These should never be undefined @@ -366,12 +357,12 @@ class LPF2Hub extends basehub_1.BaseHub { const output = utils_1.toBin(message.readUInt16LE(9), count); modeInfoDebug(`Port ${utils_1.toHex(port)}, total modes ${count}, input modes ${input}, output modes ${output}`); for (let i = 0; i < count; i++) { - await this._sendModeInformationRequest(port, i, 0x00); // Mode Name - await this._sendModeInformationRequest(port, i, 0x01); // RAW Range - await this._sendModeInformationRequest(port, i, 0x02); // PCT Range - await this._sendModeInformationRequest(port, i, 0x03); // SI Range - await this._sendModeInformationRequest(port, i, 0x04); // SI Symbol - await this._sendModeInformationRequest(port, i, 0x80); // Value Format + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.NAME); + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.RAW); + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.PCT); + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.SI); + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.SYMBOL); + await this._sendModeInformationRequest(port, i, Consts.ModeInformationType.VALUE_FORMAT); } } _sendModeInformationRequest(port, mode, type) { @@ -382,22 +373,22 @@ class LPF2Hub extends basehub_1.BaseHub { const mode = message[4]; const type = message[5]; switch (type) { - case 0x00: // Mode Name + case Consts.ModeInformationType.NAME: modeInfoDebug(`Port ${port}, mode ${mode}, name ${message.slice(6, message.length).toString()}`); break; - case 0x01: // RAW Range + case Consts.ModeInformationType.RAW: modeInfoDebug(`Port ${port}, mode ${mode}, RAW min ${message.readFloatLE(6)}, max ${message.readFloatLE(10)}`); break; - case 0x02: // PCT Range + case Consts.ModeInformationType.PCT: modeInfoDebug(`Port ${port}, mode ${mode}, PCT min ${message.readFloatLE(6)}, max ${message.readFloatLE(10)}`); break; - case 0x03: // SI Range + case Consts.ModeInformationType.SI: modeInfoDebug(`Port ${port}, mode ${mode}, SI min ${message.readFloatLE(6)}, max ${message.readFloatLE(10)}`); break; - case 0x04: // SI Symbol + case Consts.ModeInformationType.SYMBOL: modeInfoDebug(`Port ${port}, mode ${mode}, SI symbol ${message.slice(6, message.length).toString()}`); break; - case 0x80: // Value Format + case Consts.ModeInformationType.VALUE_FORMAT: const numValues = message[6]; const dataType = ["8bit", "16bit", "32bit", "float"][message[7]]; const totalFigures = message[8]; @@ -467,9 +458,9 @@ exports.LPF2Hub = LPF2Hub; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_mario.js.html b/docs/hubs_mario.js.html new file mode 100644 index 0000000..a17ba51 --- /dev/null +++ b/docs/hubs_mario.js.html @@ -0,0 +1,269 @@ + + + + + + + node-poweredup Source: hubs/mario.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: hubs/mario.js

+ +
+
+
"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PortMap = exports.Mario = void 0;
+const lpf2hub_1 = require("./lpf2hub");
+const Consts = __importStar(require("../consts"));
+const Debug = require("debug");
+const debug = Debug("movehub");
+/**
+ * Mario is emitted if the discovered device is a LEGO Super Mario brick.
+ * @class Mario
+ * @extends LPF2Hub
+ * @extends BaseHub
+ */
+class Mario extends lpf2hub_1.LPF2Hub {
+    static IsMario(peripheral) {
+        return (peripheral.advertisement &&
+            peripheral.advertisement.serviceUuids &&
+            peripheral.advertisement.serviceUuids.indexOf(Consts.BLEService.LPF2_HUB.replace(/-/g, "")) >= 0 &&
+            peripheral.advertisement.manufacturerData &&
+            peripheral.advertisement.manufacturerData.length > 3 &&
+            peripheral.advertisement.manufacturerData[3] === Consts.BLEManufacturerData.MARIO_ID);
+    }
+    constructor(device) {
+        super(device, exports.PortMap, Consts.HubType.MOVE_HUB);
+        debug("Discovered Mario");
+    }
+    async connect() {
+        debug("Connecting to Mario");
+        await super.connect();
+        debug("Connect completed");
+    }
+}
+exports.Mario = Mario;
+exports.PortMap = {};
+//# sourceMappingURL=mario.js.map
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/hubs_movehub.js.html b/docs/hubs_movehub.js.html index bd67bfe..edfd9f4 100644 --- a/docs/hubs_movehub.js.html +++ b/docs/hubs_movehub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -191,9 +191,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_puphub.js.html b/docs/hubs_puphub.js.html index 1a0f23d..d7a14cf 100644 --- a/docs/hubs_puphub.js.html +++ b/docs/hubs_puphub.js.html @@ -33,14 +33,14 @@ @@ -177,9 +177,9 @@ exports.PUPHub = PUPHub; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_pupremote.js.html b/docs/hubs_pupremote.js.html index 5be4e4c..2743b5e 100644 --- a/docs/hubs_pupremote.js.html +++ b/docs/hubs_pupremote.js.html @@ -33,14 +33,14 @@ @@ -170,9 +170,9 @@ exports.PUPRemote = PUPRemote; - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_remotecontrol.js.html b/docs/hubs_remotecontrol.js.html index 18d690b..02ff530 100644 --- a/docs/hubs_remotecontrol.js.html +++ b/docs/hubs_remotecontrol.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -179,9 +179,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_technicmediumhub.js.html b/docs/hubs_technicmediumhub.js.html index 0e06fd3..0f8fbf8 100644 --- a/docs/hubs_technicmediumhub.js.html +++ b/docs/hubs_technicmediumhub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -125,7 +125,6 @@ class TechnicMediumHub extends lpf2hub_1.LPF2Hub { async connect() { debug("Connecting to Control+ Hub"); await super.connect(); - await this.send(Buffer.from([0x41, 0x3d, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01]), Consts.BLECharacteristic.LPF2_ALL); // Temperature debug("Connect completed"); } } @@ -185,9 +184,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/hubs_wedo2smarthub.js.html b/docs/hubs_wedo2smarthub.js.html index 4b0af76..9e2f229 100644 --- a/docs/hubs_wedo2smarthub.js.html +++ b/docs/hubs_wedo2smarthub.js.html @@ -33,14 +33,14 @@ @@ -93,7 +93,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.cr var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -122,7 +122,7 @@ class WeDo2SmartHub extends basehub_1.BaseHub { peripheral.advertisement.serviceUuids.indexOf(Consts.BLEService.WEDO2_SMART_HUB.replace(/-/g, "")) >= 0); } connect() { - return new Promise(async (resolve, reject) => { + return new Promise(async (resolve) => { debug("Connecting to WeDo 2.0 Smart Hub"); await super.connect(); await this._bleDevice.discoverCharacteristicsForService(Consts.BLEService.WEDO2_SMART_HUB); @@ -193,7 +193,7 @@ class WeDo2SmartHub extends basehub_1.BaseHub { if (name.length > 14) { throw new Error("Name must be 14 characters or less"); } - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const data = Buffer.from(name, "ascii"); // Send this twice, as sometimes the first time doesn't take this.send(data, Consts.BLECharacteristic.WEDO2_NAME_ID); @@ -330,9 +330,9 @@ exports.PortMap = { - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index a2018ad..79fa02e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,14 +33,14 @@ @@ -97,16 +97,27 @@ NPM Version

node-poweredup - A Javascript module to interface with LEGO Powered Up components.

Announcements

-

Important: v6.0.0 is a complete re-architecting of this library. Improvements include proper device and mode support through an external Device object, correct handling of firmware features, and promise-based functionality for interfacing with device attachments. Although many new features were added, existing code will almost surely break upon upgrade.

+

Introduction

-

LEGO Powered Up is the successor to Power Functions, the system for adding electronics to LEGO models. Powered Up is a collection of ranges - starting with LEGO Education WeDo 2.0 released in 2016, LEGO Boost released in 2017, LEGO Powered Up released in 2018, LEGO Technic CONTROL+ released in 2019, and LEGO Education SPIKE Prime released in 2020. It also includes the 2018 Duplo App-Controlled Train sets.

+

LEGO Powered Up is the successor to Power Functions, the system for adding electronics to LEGO models. Powered Up is a collection of ranges, all of which are compatible with each other:

+ +

Other products that speak the Powered Up protocol include the Duplo App-Controlled trains and LEGO Super Mario, both of which are compatible with this library.

This library allows communication and control of Powered Up devices and peripherals via Javascript, both from Node.js and from the browser using Web Bluetooth.

Node.js Installation

Node.js v8.0+ required.

npm install node-poweredup --save
 
-

node-poweredup uses the Noble BLE library by Sandeep Mistry. On macOS everything should function out of the box. On Linux and Windows there are certain dependencies which may need installed first.

-

Note: node-poweredup has been tested on macOS 10.15 and Debian/Raspbian on the Raspberry Pi 3 Model B.

+

node-poweredup uses the Noble BLE library by Sandeep Mistry. On macOS everything should function out of the box. On Linux and Windows there are certain dependencies which may need installed first.

+

Note: node-poweredup has been tested on macOS 11.0 and Debian/Raspbian on the Raspberry Pi 3 Model B.

Compatibility

While most Powered Up components and Hubs are compatible with each other, there are exceptions. For example, there is limited backwards compatibility between newer components and the WeDo 2.0 Smart Hub. However WeDo 2.0 components are fully forwards compatible with newer Hubs.

@@ -218,7 +229,7 @@ - + @@ -228,7 +239,7 @@ - + @@ -238,7 +249,7 @@ - + @@ -248,7 +259,7 @@ - + @@ -257,7 +268,7 @@ - + @@ -312,6 +323,12 @@ + + + + + +
45678 Motor/Sensor PartialYesNo Yes Yes 4567845678 Motor/Sensor PartialYesNo Yes Yes 4567845678 Sensor NoYesNo Yes Yes 4567845678 Sensor NoYesNo Yes Yes 45678SPIKE Prime Force Sensor 45678 SensorNoPartial Yes Yes YesRGB LED
Button
Tilt Sensor
Accelerometer
42099
42100
Super Mario71360Pants Sensor
Barcode and Color Sensor
71360

Known Issues and Limitations

@@ -320,10 +337,13 @@

The WeDo 2.0 Smart Hub uses an older firmware which is no longer being updated. As a result, only certain motors and sensors work with it. See the table above.

  • -

    When used with the Boost Move Hub, the Control+ Motors do not currently accept commands (This is a known but which requires a firmware update from Lego to fix)

    +

    When used with the Boost Move Hub, the Control+ Motors and SPIKE Prime Motors/Sensors do not currently accept commands (This is a known bug which requires a firmware update from Lego to fix)

  • -

    The SPIKE Prime Hub does not use Bluetooth Low Energy, so is not supported via this library. It is recommended you use MicroPython and Bluetooth Classic to develop for this Hub.

    +

    The SPIKE Prime Hub does not use Bluetooth Low Energy, so is not supported via this library. It is recommended you use MicroPython to develop for this Hub using the officially provided tools and software.

    +
  • +
  • +

    On most Unix systems, you need root permissions to access Bluetooth devices. You may want to grant the node executable access to the Bluetooth adapter

  • Documentation

    @@ -408,9 +428,9 @@ console.log("Scanning for Hubs..."); - Documentation generated by JSDoc 3.6.4 + Documentation generated by JSDoc 3.6.6 - on Thu Jun 4th 2020 + on Tue Dec 22nd 2020 using the DocStrap template. diff --git a/docs/quicksearch.html b/docs/quicksearch.html index 7e99784..471e8b3 100644 --- a/docs/quicksearch.html +++ b/docs/quicksearch.html @@ -7,7 +7,7 @@