From ddb71b5d05df2be37bbad699bdc78e6c93105f76 Mon Sep 17 00:00:00 2001 From: Nathan Kellenicki Date: Tue, 18 Jan 2022 17:49:56 -0800 Subject: [PATCH] Updated docs --- docs/AbsoluteMotor.html | 2 +- docs/BaseHub.html | 2 +- docs/BasicMotor.html | 2 +- docs/ColorDistanceSensor.html | 802 +++++++++++++++++- docs/CurrentSensor.html | 2 +- docs/Device.html | 2 +- docs/DuploTrainBase.html | 2 +- docs/DuploTrainBaseColorSensor.html | 2 +- docs/DuploTrainBaseMotor.html | 2 +- docs/DuploTrainBaseSpeaker.html | 2 +- docs/DuploTraniBaseSpeedometer.html | 2 +- docs/Hub.html | 2 +- docs/HubLED.html | 2 +- docs/LPF2Hub.html | 2 +- docs/Light.html | 2 +- docs/Mario.html | 2 +- docs/MarioAccelerometer.html | 2 +- docs/MarioBarcodeSensor.html | 2 +- docs/MarioPantsSensor.html | 2 +- docs/MediumLinearMotor.html | 2 +- docs/MotionSensor.html | 2 +- docs/MoveHub.html | 2 +- docs/MoveHubMediumLinearMotor.html | 2 +- docs/MoveHubTiltSensor.html | 2 +- docs/PiezoBuzzer.html | 2 +- docs/PoweredUP.html | 36 +- docs/RemoteControl.html | 2 +- docs/RemoteControlButton.html | 2 +- docs/SimpleMediumLinearMotor.html | 2 +- docs/TachoMotor.html | 2 +- docs/Technic3x3ColorLightMatrix.html | 2 +- docs/TechnicColorSensor.html | 2 +- docs/TechnicDistanceSensor.html | 2 +- docs/TechnicForceSensor.html | 2 +- docs/TechnicLargeAngularMotor.html | 2 +- docs/TechnicLargeLinearMotor.html | 2 +- docs/TechnicMediumAngularMotor.html | 2 +- docs/TechnicMediumHub.html | 2 +- docs/TechnicMediumHubAccelerometerSensor.html | 2 +- docs/TechnicMediumHubGyroSensor.html | 2 +- docs/TechnicMediumHubTiltSensor.html | 592 ++++++++++++- docs/TechnicSmallAngularMotor.html | 2 +- docs/TechnicXLargeLinearMotor.html | 2 +- docs/TiltSensor.html | 2 +- docs/TrainMotor.html | 2 +- docs/VoltageSensor.html | 2 +- docs/WeDo2SmartHub.html | 2 +- docs/consts.js.html | 67 +- docs/devices_absolutemotor.js.html | 2 +- docs/devices_basicmotor.js.html | 2 +- docs/devices_colordistancesensor.js.html | 96 ++- docs/devices_currentsensor.js.html | 2 +- docs/devices_device.js.html | 2 +- .../devices_duplotrainbasecolorsensor.js.html | 2 +- docs/devices_duplotrainbasemotor.js.html | 2 +- docs/devices_duplotrainbasespeaker.js.html | 2 +- .../devices_duplotrainbasespeedometer.js.html | 2 +- docs/devices_hubled.js.html | 2 +- docs/devices_light.js.html | 2 +- docs/devices_marioaccelerometer.js.html | 2 +- docs/devices_mariobarcodesensor.js.html | 2 +- docs/devices_mariopantssensor.js.html | 2 +- docs/devices_mediumlinearmotor.js.html | 2 +- docs/devices_motionsensor.js.html | 2 +- docs/devices_movehubmediumlinearmotor.js.html | 2 +- docs/devices_movehubtiltsensor.js.html | 2 +- docs/devices_piezobuzzer.js.html | 2 +- docs/devices_remotecontrolbutton.js.html | 2 +- docs/devices_simplemediumlinearmotor.js.html | 2 +- docs/devices_tachomotor.js.html | 2 +- ...devices_technic3x3colorlightmatrix.js.html | 2 +- docs/devices_techniccolorsensor.js.html | 2 +- docs/devices_technicdistancesensor.js.html | 2 +- docs/devices_technicforcesensor.js.html | 2 +- docs/devices_techniclargeangularmotor.js.html | 2 +- docs/devices_techniclargelinearmotor.js.html | 2 +- .../devices_technicmediumangularmotor.js.html | 2 +- ...echnicmediumhubaccelerometersensor.js.html | 2 +- ...devices_technicmediumhubgyrosensor.js.html | 2 +- ...devices_technicmediumhubtiltsensor.js.html | 74 +- docs/devices_technicsmallangularmotor.js.html | 2 +- docs/devices_technicxlargelinearmotor.js.html | 2 +- docs/devices_tiltsensor.js.html | 2 +- docs/devices_trainmotor.js.html | 2 +- docs/devices_voltagesensor.js.html | 2 +- docs/global.html | 589 +++++++++++-- docs/hubs_basehub.js.html | 2 +- docs/hubs_duplotrainbase.js.html | 2 +- docs/hubs_hub.js.html | 2 +- docs/hubs_lpf2hub.js.html | 2 +- docs/hubs_mario.js.html | 2 +- docs/hubs_movehub.js.html | 2 +- docs/hubs_remotecontrol.js.html | 2 +- docs/hubs_technicmediumhub.js.html | 2 +- docs/hubs_technicsmallhub.js.html | 2 +- docs/hubs_wedo2smarthub.js.html | 2 +- docs/index.html | 2 +- docs/poweredup-browser.js.html | 2 +- docs/poweredup-node.js.html | 27 +- 99 files changed, 2267 insertions(+), 198 deletions(-) diff --git a/docs/AbsoluteMotor.html b/docs/AbsoluteMotor.html index 67e6d3c..3828eb2 100644 --- a/docs/AbsoluteMotor.html +++ b/docs/AbsoluteMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/BaseHub.html b/docs/BaseHub.html index 79ddaab..77d5212 100644 --- a/docs/BaseHub.html +++ b/docs/BaseHub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/BasicMotor.html b/docs/BasicMotor.html index e0862eb..323c6f4 100644 --- a/docs/BasicMotor.html +++ b/docs/BasicMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/ColorDistanceSensor.html b/docs/ColorDistanceSensor.html index 3c18b40..892f9b2 100644 --- a/docs/ColorDistanceSensor.html +++ b/docs/ColorDistanceSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

@@ -1120,7 +1120,7 @@
@@ -1266,7 +1266,153 @@
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ setDistanceCount(distance) → {Promise} +

+
+ + + + + +
+

Set the distance count value.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
distance + + + + count + + + + + + + +

count between 0 and 2^32

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+
@@ -1413,7 +1559,7 @@
@@ -1617,7 +1763,7 @@
@@ -1822,7 +1968,7 @@
@@ -1862,6 +2008,152 @@ + + + + + + +

+ ambient :object +

+
+ + + + + +
+

Event measuring abient light change, emits when the sensor is activated.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
percentage + + + + number + + + + + + + +

from 0 to 100.

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -2151,7 +2443,7 @@
@@ -2324,6 +2616,502 @@ + + + + + + + + + + + +

+ distanceCount :object +

+
+ + + + + +
+

Emits when distance is reduced to less than 10 centimeters.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + + + number + + + + + + + +

of distance events.

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

+ reflect :object +

+
+ + + + + +
+

Event measuring reflection change, emits when the sensor is activated.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
percentage + + + + number + + + + + + + +

from 0 to 100.

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

+ rgbIntensity :object +

+
+ + + + + +
+

Emits when a color sensor is activated.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
red + + + + number + + + + + + + + + +
green + + + + number + + + + + + + + + +
blue + + + + number + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + diff --git a/docs/CurrentSensor.html b/docs/CurrentSensor.html index 97e07b9..5928319 100644 --- a/docs/CurrentSensor.html +++ b/docs/CurrentSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/Device.html b/docs/Device.html index a31a6ea..f896190 100644 --- a/docs/Device.html +++ b/docs/Device.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/DuploTrainBase.html b/docs/DuploTrainBase.html index e2edcab..26b95a6 100644 --- a/docs/DuploTrainBase.html +++ b/docs/DuploTrainBase.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/DuploTrainBaseColorSensor.html b/docs/DuploTrainBaseColorSensor.html index 1031bde..8606edf 100644 --- a/docs/DuploTrainBaseColorSensor.html +++ b/docs/DuploTrainBaseColorSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/DuploTrainBaseMotor.html b/docs/DuploTrainBaseMotor.html index 5b1a98d..40345fd 100644 --- a/docs/DuploTrainBaseMotor.html +++ b/docs/DuploTrainBaseMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/DuploTrainBaseSpeaker.html b/docs/DuploTrainBaseSpeaker.html index 87c14e3..1ab54af 100644 --- a/docs/DuploTrainBaseSpeaker.html +++ b/docs/DuploTrainBaseSpeaker.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/DuploTraniBaseSpeedometer.html b/docs/DuploTraniBaseSpeedometer.html index 0e2ead7..be88d1e 100644 --- a/docs/DuploTraniBaseSpeedometer.html +++ b/docs/DuploTraniBaseSpeedometer.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/Hub.html b/docs/Hub.html index 835173e..9967132 100644 --- a/docs/Hub.html +++ b/docs/Hub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/HubLED.html b/docs/HubLED.html index 30121bd..80fbbc6 100644 --- a/docs/HubLED.html +++ b/docs/HubLED.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/LPF2Hub.html b/docs/LPF2Hub.html index 3ad50c9..3f60c5e 100644 --- a/docs/LPF2Hub.html +++ b/docs/LPF2Hub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/Light.html b/docs/Light.html index ed9d4d9..6cf9319 100644 --- a/docs/Light.html +++ b/docs/Light.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/Mario.html b/docs/Mario.html index c625603..adc3aab 100644 --- a/docs/Mario.html +++ b/docs/Mario.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MarioAccelerometer.html b/docs/MarioAccelerometer.html index 90a4aa1..faae0d5 100644 --- a/docs/MarioAccelerometer.html +++ b/docs/MarioAccelerometer.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MarioBarcodeSensor.html b/docs/MarioBarcodeSensor.html index 46750c1..53ee131 100644 --- a/docs/MarioBarcodeSensor.html +++ b/docs/MarioBarcodeSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MarioPantsSensor.html b/docs/MarioPantsSensor.html index cedfd0c..a81f45a 100644 --- a/docs/MarioPantsSensor.html +++ b/docs/MarioPantsSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MediumLinearMotor.html b/docs/MediumLinearMotor.html index 89a255f..7bb73b6 100644 --- a/docs/MediumLinearMotor.html +++ b/docs/MediumLinearMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MotionSensor.html b/docs/MotionSensor.html index 486bd12..207e5fe 100644 --- a/docs/MotionSensor.html +++ b/docs/MotionSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MoveHub.html b/docs/MoveHub.html index ec6d814..bea3f6d 100644 --- a/docs/MoveHub.html +++ b/docs/MoveHub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MoveHubMediumLinearMotor.html b/docs/MoveHubMediumLinearMotor.html index 15176a6..9a87177 100644 --- a/docs/MoveHubMediumLinearMotor.html +++ b/docs/MoveHubMediumLinearMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/MoveHubTiltSensor.html b/docs/MoveHubTiltSensor.html index 58ee2fd..9544c81 100644 --- a/docs/MoveHubTiltSensor.html +++ b/docs/MoveHubTiltSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/PiezoBuzzer.html b/docs/PiezoBuzzer.html index 9e40a27..f0894b1 100644 --- a/docs/PiezoBuzzer.html +++ b/docs/PiezoBuzzer.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/PoweredUP.html b/docs/PoweredUP.html index c6011e5..d985027 100644 --- a/docs/PoweredUP.html +++ b/docs/PoweredUP.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

@@ -482,7 +482,7 @@
@@ -774,7 +774,7 @@
@@ -956,7 +956,7 @@
@@ -1248,7 +1248,7 @@
@@ -1540,7 +1540,7 @@
@@ -1722,7 +1722,7 @@
@@ -1813,7 +1813,7 @@
@@ -2161,7 +2161,7 @@
@@ -2271,7 +2271,7 @@
@@ -2592,7 +2592,7 @@
@@ -2884,7 +2884,7 @@
@@ -3066,7 +3066,7 @@
@@ -3358,7 +3358,7 @@
@@ -3650,7 +3650,7 @@
@@ -3832,7 +3832,7 @@
@@ -3923,7 +3923,7 @@
@@ -4271,7 +4271,7 @@
diff --git a/docs/RemoteControl.html b/docs/RemoteControl.html index ea55b62..bc7369f 100644 --- a/docs/RemoteControl.html +++ b/docs/RemoteControl.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/RemoteControlButton.html b/docs/RemoteControlButton.html index cf6697d..95b734a 100644 --- a/docs/RemoteControlButton.html +++ b/docs/RemoteControlButton.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/SimpleMediumLinearMotor.html b/docs/SimpleMediumLinearMotor.html index 79f2fb2..b8d635f 100644 --- a/docs/SimpleMediumLinearMotor.html +++ b/docs/SimpleMediumLinearMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TachoMotor.html b/docs/TachoMotor.html index 2be256c..d20e047 100644 --- a/docs/TachoMotor.html +++ b/docs/TachoMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/Technic3x3ColorLightMatrix.html b/docs/Technic3x3ColorLightMatrix.html index 021202f..c06fc6d 100644 --- a/docs/Technic3x3ColorLightMatrix.html +++ b/docs/Technic3x3ColorLightMatrix.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicColorSensor.html b/docs/TechnicColorSensor.html index 9f13912..03ef2c7 100644 --- a/docs/TechnicColorSensor.html +++ b/docs/TechnicColorSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicDistanceSensor.html b/docs/TechnicDistanceSensor.html index b2279c6..685406b 100644 --- a/docs/TechnicDistanceSensor.html +++ b/docs/TechnicDistanceSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicForceSensor.html b/docs/TechnicForceSensor.html index bcfef70..1f72312 100644 --- a/docs/TechnicForceSensor.html +++ b/docs/TechnicForceSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicLargeAngularMotor.html b/docs/TechnicLargeAngularMotor.html index 9e7fc3d..af94f32 100644 --- a/docs/TechnicLargeAngularMotor.html +++ b/docs/TechnicLargeAngularMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicLargeLinearMotor.html b/docs/TechnicLargeLinearMotor.html index cecbd53..39fb1e8 100644 --- a/docs/TechnicLargeLinearMotor.html +++ b/docs/TechnicLargeLinearMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicMediumAngularMotor.html b/docs/TechnicMediumAngularMotor.html index 1533d45..dc1f109 100644 --- a/docs/TechnicMediumAngularMotor.html +++ b/docs/TechnicMediumAngularMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicMediumHub.html b/docs/TechnicMediumHub.html index 7b0ed46..fd0278f 100644 --- a/docs/TechnicMediumHub.html +++ b/docs/TechnicMediumHub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicMediumHubAccelerometerSensor.html b/docs/TechnicMediumHubAccelerometerSensor.html index 98ed983..007ec1d 100644 --- a/docs/TechnicMediumHubAccelerometerSensor.html +++ b/docs/TechnicMediumHubAccelerometerSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicMediumHubGyroSensor.html b/docs/TechnicMediumHubGyroSensor.html index 65e8826..0b9a2c3 100644 --- a/docs/TechnicMediumHubGyroSensor.html +++ b/docs/TechnicMediumHubGyroSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicMediumHubTiltSensor.html b/docs/TechnicMediumHubTiltSensor.html index 3ba91a7..a164ad4 100644 --- a/docs/TechnicMediumHubTiltSensor.html +++ b/docs/TechnicMediumHubTiltSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

@@ -998,6 +998,448 @@ +

Methods

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

+ setImpactCount(impact) → {Promise} +

+
+ + + + + +
+

Set the impact count value.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
impact + + + + count + + + + + + + +

count between 0 and 2^32

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

+ setImpactHoldoff(value) → {Promise} +

+
+ + + + + +
+

Set the impact holdoff time.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + holdoff + + + + + + + +

between 1 and 127

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

+ setImpactThreshold(value) → {Promise} +

+
+ + + + + +
+

Set the impact threshold.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + + + threshold + + + + + + + +

between 1 and 127

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + @@ -1010,6 +1452,152 @@ + + + + + + +

+ impactCount :object +

+
+ + + + + +
+

Emits when proper acceleration is above threshold (e.g. on impact when being thrown to the ground).

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + + + number + + + + + + + +

of impact events.

+ +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -1182,7 +1770,7 @@
diff --git a/docs/TechnicSmallAngularMotor.html b/docs/TechnicSmallAngularMotor.html index 4d2d839..5ef5cfc 100644 --- a/docs/TechnicSmallAngularMotor.html +++ b/docs/TechnicSmallAngularMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TechnicXLargeLinearMotor.html b/docs/TechnicXLargeLinearMotor.html index 15f21a7..f69598c 100644 --- a/docs/TechnicXLargeLinearMotor.html +++ b/docs/TechnicXLargeLinearMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TiltSensor.html b/docs/TiltSensor.html index 356a454..593602b 100644 --- a/docs/TiltSensor.html +++ b/docs/TiltSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/TrainMotor.html b/docs/TrainMotor.html index 7276564..4890345 100644 --- a/docs/TrainMotor.html +++ b/docs/TrainMotor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/VoltageSensor.html b/docs/VoltageSensor.html index b8b5e0a..72fdfd0 100644 --- a/docs/VoltageSensor.html +++ b/docs/VoltageSensor.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/WeDo2SmartHub.html b/docs/WeDo2SmartHub.html index abba436..3128113 100644 --- a/docs/WeDo2SmartHub.html +++ b/docs/WeDo2SmartHub.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/consts.js.html b/docs/consts.js.html index 582df7d..5698802 100644 --- a/docs/consts.js.html +++ b/docs/consts.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

@@ -98,11 +98,12 @@ exports.MarioColor = exports.MarioPantsType = exports.PortInputFormatSetupSubCom * @property {number} UNKNOWN 0 * @property {number} WEDO2_SMART_HUB 1 * @property {number} MOVE_HUB 2 - * @property {number} POWERED_UP_HUB 3 - * @property {number} POWERED_UP_REMOTE 4 - * @property {number} DUPLO_TRAIN_HUB 5 - * @property {number} CONTROL_PLUS_HUB 6 + * @property {number} HUB 3 + * @property {number} REMOTE_CONTROL 4 + * @property {number} DUPLO_TRAIN_BASE 5 + * @property {number} TECHNIC_MEDIUM_HUB 6 * @property {number} MARIO 7 + * @property {number} TECHNIC_SMALL_HUB 8 */ var HubType; (function (HubType) { @@ -123,27 +124,42 @@ exports.HubTypeNames = HubType; * @property {number} UNKNOWN 0 * @property {number} SIMPLE_MEDIUM_LINEAR_MOTOR 1 * @property {number} TRAIN_MOTOR 2 - * @property {number} LED_LIGHTS 8 - * @property {number} VOLTAGE 20 - * @property {number} CURRENT 21 - * @property {number} PIEZO_TONE 22 - * @property {number} RGB_LIGHT 23 - * @property {number} WEDO2_TILT 34 - * @property {number} WEDO2_DISTANCE 35 + * @property {number} LIGHT 8 + * @property {number} VOLTAGE_SENSOR 20 + * @property {number} CURRENT_SENSOR 21 + * @property {number} PIEZO_BUZZER 22 + * @property {number} HUB_LED 23 + * @property {number} TILT_SENSOR 34 + * @property {number} MOTION_SENSOR 35 * @property {number} COLOR_DISTANCE_SENSOR 37 * @property {number} MEDIUM_LINEAR_MOTOR 38 * @property {number} MOVE_HUB_MEDIUM_LINEAR_MOTOR 39 - * @property {number} BOOST_TILT 40 + * @property {number} MOVE_HUB_TILT_SENSOR 40 * @property {number} DUPLO_TRAIN_BASE_MOTOR 41 * @property {number} DUPLO_TRAIN_BASE_SPEAKER 42 - * @property {number} DUPLO_TRAIN_BASE_COLOR 43 + * @property {number} DUPLO_TRAIN_BASE_COLOR_SENSOR 43 * @property {number} DUPLO_TRAIN_BASE_SPEEDOMETER 44 - * @property {number} CONTROL_PLUS_LARGE_MOTOR 46 - * @property {number} CONTROL_PLUS_XLARGE_MOTOR 47 - * @property {number} POWERED_UP_REMOTE_BUTTON 55 - * @property {number} RSSI 56 - * @property {number} CONTROL_PLUS_ACCELEROMETER 58 - * @property {number} CONTROL_PLUS_TILT 59 + * @property {number} TECHNIC_LARGE_LINEAR_MOTOR 46 + * @property {number} TECHNIC_XLARGE_LINEAR_MOTOR 47 + * @property {number} TECHNIC_MEDIUM_ANGULAR_MOTOR 48 + * @property {number} TECHNIC_LARGE_ANGULAR_MOTOR 49 + * @property {number} TECHNIC_MEDIUM_HUB_GEST_SENSOR 54 + * @property {number} REMOTE_CONTROL_BUTTON 55 + * @property {number} REMOTE_CONTROL_RSSI 56 + * @property {number} TECHNIC_MEDIUM_HUB_ACCELEROMETER 57 + * @property {number} TECHNIC_MEDIUM_HUB_GYRO_SENSOR 58 + * @property {number} TECHNIC_MEDIUM_HUB_TILT_SENSOR 59 + * @property {number} TECHNIC_MEDIUM_HUB_TEMPERATURE_SENSOR 60 + * @property {number} TECHNIC_COLOR_SENSOR 61 + * @property {number} TECHNIC_DISTANCE_SENSOR 62 + * @property {number} TECHNIC_FORCE_SENSOR 63 + * @property {number} TECHNIC_3X3_COLOR_LIGHT_MATRIX 64 + * @property {number} TECHNIC_SMALL_ANGULAR_MOTOR 65 + * @property {number} MARIO_ACCELEROMETER 71 + * @property {number} MARIO_BARCODE_SENSOR 73 + * @property {number} MARIO_PANTS_SENSOR 74 + * @property {number} TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY 75 + * @property {number} TECHNIC_LARGE_ANGULAR_MOTOR_GREY 76 */ var DeviceType; (function (DeviceType) { @@ -223,11 +239,11 @@ var Color; exports.ColorNames = Color; /** * @typedef ButtonState - * @property {number} PRESSED 0 - * @property {number} RELEASED 1 - * @property {number} UP 2 - * @property {number} DOWN 3 - * @property {number} STOP 4 + * @property {number} PRESSED 2 + * @property {number} RELEASED 0 + * @property {number} UP 1 + * @property {number} DOWN 255 + * @property {number} STOP 127 */ var ButtonState; (function (ButtonState) { @@ -239,6 +255,7 @@ var ButtonState; })(ButtonState = exports.ButtonState || (exports.ButtonState = {})); /** * @typedef BrakingStyle + * @property {number} FLOAT 0 * @property {number} HOLD 127 * @property {number} BRAKE 128 */ diff --git a/docs/devices_absolutemotor.js.html b/docs/devices_absolutemotor.js.html index e7100ac..0964e66 100644 --- a/docs/devices_absolutemotor.js.html +++ b/docs/devices_absolutemotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_basicmotor.js.html b/docs/devices_basicmotor.js.html index 69f8bb1..14663f3 100644 --- a/docs/devices_basicmotor.js.html +++ b/docs/devices_basicmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_colordistancesensor.js.html b/docs/devices_colordistancesensor.js.html index 35cd5dc..1760a9f 100644 --- a/docs/devices_colordistancesensor.js.html +++ b/docs/devices_colordistancesensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

@@ -143,7 +143,7 @@ class ColorDistanceSensor extends device_1.Device { break; } if (message[4] <= 10) { - let distance = Math.floor(message[4] * 25.4); + let distance = Math.floor(message[4] * 25.4) - 20; if (distance < 0) { distance = 0; } @@ -156,6 +156,70 @@ class ColorDistanceSensor extends device_1.Device { this.notify("distance", { distance }); } break; + case Mode.DISTANCE_COUNT: + if (this.isWeDo2SmartHub) { + break; + } + if (message.length !== 8) { + // if mode of device has not changed to this._mode yet + break; + } + const count = message.readUInt32LE(4); + /** + * Emits when distance is reduced to less than 10 centimeters. + * @event ColorDistanceSensor#distanceCount + * @type {object} + * @param {number} number of distance events. + */ + this.notify("distanceCount", { count }); + break; + case Mode.REFLECT: + if (this.isWeDo2SmartHub) { + break; + } + const reflect = message[4]; + /** + * Event measuring reflection change, emits when the sensor is activated. + * @event ColorDistanceSensor#reflect + * @type {object} + * @param {number} percentage from 0 to 100. + */ + this.notify("reflect", { reflect }); + break; + case Mode.AMBIENT: + if (this.isWeDo2SmartHub) { + break; + } + const ambient = message[4]; + /** + * Event measuring abient light change, emits when the sensor is activated. + * @event ColorDistanceSensor#ambient + * @type {object} + * @param {number} percentage from 0 to 100. + */ + this.notify("ambient", { ambient }); + break; + case Mode.RGB_I: + if (this.isWeDo2SmartHub) { + break; + } + if (message.length !== 10) { + // if mode of device has not changed to this._mode yet + break; + } + const red = message.readUInt16LE(4); + const green = message.readUInt16LE(6); + const blue = message.readUInt16LE(8); + /** + * Emits when a color sensor is activated. + * @event ColorDistanceSensor#rgbIntensity + * @type {object} + * @param {number} red + * @param {number} green + * @param {number} blue + */ + this.notify("rgbIntensity", { red, green, blue }); + break; case Mode.COLOR_AND_DISTANCE: if (this.isWeDo2SmartHub) { break; @@ -281,6 +345,26 @@ class ColorDistanceSensor extends device_1.Device { return resolve(); }); } + /** + * Set the distance count value. + * @method ColorDistanceSensor#setDistanceCount + * @param {count} distance count between 0 and 2^32 + * @returns {Promise} Resolved upon successful issuance of the command. + */ + setDistanceCount(count) { + return new Promise((resolve) => { + if (this.isWeDo2SmartHub) { + throw new Error("Setting distance count is not available on the WeDo 2.0 Smart Hub"); + } + else { + const payload = Buffer.alloc(4); + payload.writeUInt32LE(count % 2 ** 32); + // no need to subscribe, can be set in different mode + this.writeDirect(0x02, payload); + } + return resolve(); + }); + } _pfPowerToPWM(power) { return power & 15; } @@ -290,13 +374,21 @@ var Mode; (function (Mode) { Mode[Mode["COLOR"] = 0] = "COLOR"; Mode[Mode["DISTANCE"] = 1] = "DISTANCE"; + Mode[Mode["DISTANCE_COUNT"] = 2] = "DISTANCE_COUNT"; + Mode[Mode["REFLECT"] = 3] = "REFLECT"; + Mode[Mode["AMBIENT"] = 4] = "AMBIENT"; Mode[Mode["LED"] = 5] = "LED"; + Mode[Mode["RGB_I"] = 6] = "RGB_I"; Mode[Mode["PF_IR"] = 7] = "PF_IR"; Mode[Mode["COLOR_AND_DISTANCE"] = 8] = "COLOR_AND_DISTANCE"; })(Mode = exports.Mode || (exports.Mode = {})); exports.ModeMap = { "color": Mode.COLOR, "distance": Mode.DISTANCE, + "distanceCount": Mode.DISTANCE_COUNT, + "reflect": Mode.REFLECT, + "ambient": Mode.AMBIENT, + "rgbIntensity": Mode.RGB_I, "colorAndDistance": Mode.COLOR_AND_DISTANCE }; var Output; diff --git a/docs/devices_currentsensor.js.html b/docs/devices_currentsensor.js.html index 0fb98c8..31066d9 100644 --- a/docs/devices_currentsensor.js.html +++ b/docs/devices_currentsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_device.js.html b/docs/devices_device.js.html index 9701e84..590cfc6 100644 --- a/docs/devices_device.js.html +++ b/docs/devices_device.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_duplotrainbasecolorsensor.js.html b/docs/devices_duplotrainbasecolorsensor.js.html index 1c88ff3..e361401 100644 --- a/docs/devices_duplotrainbasecolorsensor.js.html +++ b/docs/devices_duplotrainbasecolorsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_duplotrainbasemotor.js.html b/docs/devices_duplotrainbasemotor.js.html index d04a5f7..c8e9660 100644 --- a/docs/devices_duplotrainbasemotor.js.html +++ b/docs/devices_duplotrainbasemotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_duplotrainbasespeaker.js.html b/docs/devices_duplotrainbasespeaker.js.html index e599fab..e5b04dc 100644 --- a/docs/devices_duplotrainbasespeaker.js.html +++ b/docs/devices_duplotrainbasespeaker.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_duplotrainbasespeedometer.js.html b/docs/devices_duplotrainbasespeedometer.js.html index b704180..5a2534a 100644 --- a/docs/devices_duplotrainbasespeedometer.js.html +++ b/docs/devices_duplotrainbasespeedometer.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_hubled.js.html b/docs/devices_hubled.js.html index 7fc3739..bf5ff81 100644 --- a/docs/devices_hubled.js.html +++ b/docs/devices_hubled.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_light.js.html b/docs/devices_light.js.html index ad0c686..f5ad583 100644 --- a/docs/devices_light.js.html +++ b/docs/devices_light.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_marioaccelerometer.js.html b/docs/devices_marioaccelerometer.js.html index 0f7a188..d7ebc34 100644 --- a/docs/devices_marioaccelerometer.js.html +++ b/docs/devices_marioaccelerometer.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_mariobarcodesensor.js.html b/docs/devices_mariobarcodesensor.js.html index 02f1834..cba56c5 100644 --- a/docs/devices_mariobarcodesensor.js.html +++ b/docs/devices_mariobarcodesensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_mariopantssensor.js.html b/docs/devices_mariopantssensor.js.html index 6f99117..682eb32 100644 --- a/docs/devices_mariopantssensor.js.html +++ b/docs/devices_mariopantssensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_mediumlinearmotor.js.html b/docs/devices_mediumlinearmotor.js.html index 1159fcd..5166c43 100644 --- a/docs/devices_mediumlinearmotor.js.html +++ b/docs/devices_mediumlinearmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_motionsensor.js.html b/docs/devices_motionsensor.js.html index d44e5fd..cf982e5 100644 --- a/docs/devices_motionsensor.js.html +++ b/docs/devices_motionsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_movehubmediumlinearmotor.js.html b/docs/devices_movehubmediumlinearmotor.js.html index a777826..11bae54 100644 --- a/docs/devices_movehubmediumlinearmotor.js.html +++ b/docs/devices_movehubmediumlinearmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_movehubtiltsensor.js.html b/docs/devices_movehubtiltsensor.js.html index 80a0099..eb78073 100644 --- a/docs/devices_movehubtiltsensor.js.html +++ b/docs/devices_movehubtiltsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_piezobuzzer.js.html b/docs/devices_piezobuzzer.js.html index d3d214a..cdfe18d 100644 --- a/docs/devices_piezobuzzer.js.html +++ b/docs/devices_piezobuzzer.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_remotecontrolbutton.js.html b/docs/devices_remotecontrolbutton.js.html index aa76120..86a64f2 100644 --- a/docs/devices_remotecontrolbutton.js.html +++ b/docs/devices_remotecontrolbutton.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_simplemediumlinearmotor.js.html b/docs/devices_simplemediumlinearmotor.js.html index dffce3a..4548eff 100644 --- a/docs/devices_simplemediumlinearmotor.js.html +++ b/docs/devices_simplemediumlinearmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_tachomotor.js.html b/docs/devices_tachomotor.js.html index 0cfac67..415b3b0 100644 --- a/docs/devices_tachomotor.js.html +++ b/docs/devices_tachomotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technic3x3colorlightmatrix.js.html b/docs/devices_technic3x3colorlightmatrix.js.html index 80e23eb..da151e3 100644 --- a/docs/devices_technic3x3colorlightmatrix.js.html +++ b/docs/devices_technic3x3colorlightmatrix.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_techniccolorsensor.js.html b/docs/devices_techniccolorsensor.js.html index 66b090f..c1dfb17 100644 --- a/docs/devices_techniccolorsensor.js.html +++ b/docs/devices_techniccolorsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicdistancesensor.js.html b/docs/devices_technicdistancesensor.js.html index 0c80d77..a9f2f0e 100644 --- a/docs/devices_technicdistancesensor.js.html +++ b/docs/devices_technicdistancesensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicforcesensor.js.html b/docs/devices_technicforcesensor.js.html index a805d13..4c6af18 100644 --- a/docs/devices_technicforcesensor.js.html +++ b/docs/devices_technicforcesensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_techniclargeangularmotor.js.html b/docs/devices_techniclargeangularmotor.js.html index 870ebc1..b2ac1b1 100644 --- a/docs/devices_techniclargeangularmotor.js.html +++ b/docs/devices_techniclargeangularmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_techniclargelinearmotor.js.html b/docs/devices_techniclargelinearmotor.js.html index 58aacf8..1780d74 100644 --- a/docs/devices_techniclargelinearmotor.js.html +++ b/docs/devices_techniclargelinearmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicmediumangularmotor.js.html b/docs/devices_technicmediumangularmotor.js.html index 433bd92..6f2dde6 100644 --- a/docs/devices_technicmediumangularmotor.js.html +++ b/docs/devices_technicmediumangularmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicmediumhubaccelerometersensor.js.html b/docs/devices_technicmediumhubaccelerometersensor.js.html index 7979515..6fae19b 100644 --- a/docs/devices_technicmediumhubaccelerometersensor.js.html +++ b/docs/devices_technicmediumhubaccelerometersensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicmediumhubgyrosensor.js.html b/docs/devices_technicmediumhubgyrosensor.js.html index 947a9c8..7be2f6b 100644 --- a/docs/devices_technicmediumhubgyrosensor.js.html +++ b/docs/devices_technicmediumhubgyrosensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicmediumhubtiltsensor.js.html b/docs/devices_technicmediumhubtiltsensor.js.html index dfb7ceb..8f684b7 100644 --- a/docs/devices_technicmediumhubtiltsensor.js.html +++ b/docs/devices_technicmediumhubtiltsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

@@ -121,6 +121,8 @@ const Consts = __importStar(require("../consts")); class TechnicMediumHubTiltSensor extends device_1.Device { constructor(hub, portId) { super(hub, portId, exports.ModeMap, Consts.DeviceType.TECHNIC_MEDIUM_HUB_TILT_SENSOR); + this._impactThreshold = 10; // guess of default value + this._impactHoldoff = 10; // guess of default value } receive(message) { const mode = this._mode; @@ -128,27 +130,93 @@ class TechnicMediumHubTiltSensor extends device_1.Device { case Mode.TILT: /** * Emits when a tilt sensor is activated. + * * @event TechnicMediumHubTiltSensor#tilt * @type {object} * @param {number} x * @param {number} y * @param {number} z */ - const z = -message.readInt16LE(4); + let z = -message.readInt16LE(4); const y = message.readInt16LE(6); const x = message.readInt16LE(8); + // workaround for calibration problem or bug in technicMediumHub firmware 1.1.00.0000 + if (y === 90 || y === -90) { + z = Math.sign(y) * (z + 180); + if (z > 180) + z -= 360; + if (z < -180) + z += 360; + } this.notify("tilt", { x, y, z }); break; + case Mode.IMPACT_COUNT: + if (message.length !== 8) { + // if mode of device has not changed to this._mode yet + break; + } + const count = message.readUInt32LE(4); + /** + * Emits when proper acceleration is above threshold (e.g. on impact when being thrown to the ground). + * @event TechnicMediumHubTiltSensor#impactCount + * @type {object} + * @param {number} number of impact events. + */ + this.notify("tiltCount", { count }); + break; } } + /** + * Set the impact count value. + * @method TechnicMediumHubTiltSensor#setImpactCount + * @param {count} impact count between 0 and 2^32 + * @returns {Promise} Resolved upon successful issuance of the command. + */ + setImpactCount(count) { + return new Promise((resolve) => { + const payload = Buffer.alloc(4); + payload.writeUInt32LE(count % 2 ** 32); + // no need to subscribe, can be set in different mode + this.writeDirect(0x01, payload); + return resolve(); + }); + } + /** + * Set the impact threshold. + * @method TechnicMediumHubTiltSensor#setImpactThreshold + * @param {threshold} value between 1 and 127 + * @returns {Promise} Resolved upon successful issuance of the command. + */ + setImpactThreshold(threshold) { + this._impactThreshold = threshold; + return new Promise((resolve) => { + this.writeDirect(0x02, Buffer.from([this._impactThreshold, this._impactHoldoff])); + return resolve(); + }); + } + /** + * Set the impact holdoff time. + * @method TechnicMediumHubTiltSensor#setImpactHoldoff + * @param {holdoff} value between 1 and 127 + * @returns {Promise} Resolved upon successful issuance of the command. + */ + setImpactHoldoff(holdoff) { + this._impactHoldoff = holdoff; + return new Promise((resolve) => { + this.writeDirect(0x02, Buffer.from([this._impactThreshold, this._impactHoldoff])); + return resolve(); + }); + } } exports.TechnicMediumHubTiltSensor = TechnicMediumHubTiltSensor; var Mode; (function (Mode) { Mode[Mode["TILT"] = 0] = "TILT"; + Mode[Mode["IMPACT_COUNT"] = 1] = "IMPACT_COUNT"; })(Mode = exports.Mode || (exports.Mode = {})); exports.ModeMap = { - "tilt": Mode.TILT + "tilt": Mode.TILT, + "impactCount": Mode.IMPACT_COUNT }; //# sourceMappingURL=technicmediumhubtiltsensor.js.map diff --git a/docs/devices_technicsmallangularmotor.js.html b/docs/devices_technicsmallangularmotor.js.html index 8cea67a..6cf65d1 100644 --- a/docs/devices_technicsmallangularmotor.js.html +++ b/docs/devices_technicsmallangularmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_technicxlargelinearmotor.js.html b/docs/devices_technicxlargelinearmotor.js.html index 839c70d..0e1b198 100644 --- a/docs/devices_technicxlargelinearmotor.js.html +++ b/docs/devices_technicxlargelinearmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_tiltsensor.js.html b/docs/devices_tiltsensor.js.html index 4610d8f..6232012 100644 --- a/docs/devices_tiltsensor.js.html +++ b/docs/devices_tiltsensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_trainmotor.js.html b/docs/devices_trainmotor.js.html index 26c829a..362fcc5 100644 --- a/docs/devices_trainmotor.js.html +++ b/docs/devices_trainmotor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/devices_voltagesensor.js.html b/docs/devices_voltagesensor.js.html index b1a70ac..f00765f 100644 --- a/docs/devices_voltagesensor.js.html +++ b/docs/devices_voltagesensor.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/global.html b/docs/global.html index 9b31456..16033bb 100644 --- a/docs/global.html +++ b/docs/global.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

@@ -543,7 +543,7 @@
@@ -776,7 +776,7 @@
@@ -951,7 +951,7 @@
@@ -1184,7 +1184,7 @@
@@ -1264,6 +1264,35 @@ + + + FLOAT + + + + + + + number + + + + + + + + + + + + + +

0

+ + + + + HOLD @@ -1358,7 +1387,7 @@
@@ -1461,7 +1490,7 @@ -

0

+

2

@@ -1490,7 +1519,7 @@ -

1

+

0

@@ -1519,7 +1548,7 @@ -

2

+

1

@@ -1548,7 +1577,7 @@ -

3

+

255

@@ -1577,7 +1606,7 @@ -

4

+

127

@@ -1619,7 +1648,7 @@
@@ -2083,7 +2112,7 @@
@@ -2252,7 +2281,7 @@ - LED_LIGHTS + LIGHT @@ -2281,7 +2310,7 @@ - VOLTAGE + VOLTAGE_SENSOR @@ -2310,7 +2339,7 @@ - CURRENT + CURRENT_SENSOR @@ -2339,7 +2368,7 @@ - PIEZO_TONE + PIEZO_BUZZER @@ -2368,7 +2397,7 @@ - RGB_LIGHT + HUB_LED @@ -2397,7 +2426,7 @@ - WEDO2_TILT + TILT_SENSOR @@ -2426,7 +2455,7 @@ - WEDO2_DISTANCE + MOTION_SENSOR @@ -2542,7 +2571,7 @@ - BOOST_TILT + MOVE_HUB_TILT_SENSOR @@ -2629,7 +2658,7 @@ - DUPLO_TRAIN_BASE_COLOR + DUPLO_TRAIN_BASE_COLOR_SENSOR @@ -2687,7 +2716,7 @@ - CONTROL_PLUS_LARGE_MOTOR + TECHNIC_LARGE_LINEAR_MOTOR @@ -2716,7 +2745,7 @@ - CONTROL_PLUS_XLARGE_MOTOR + TECHNIC_XLARGE_LINEAR_MOTOR @@ -2745,7 +2774,94 @@ - POWERED_UP_REMOTE_BUTTON + TECHNIC_MEDIUM_ANGULAR_MOTOR + + + + + + + number + + + + + + + + + + + + + +

48

+ + + + + + + + TECHNIC_LARGE_ANGULAR_MOTOR + + + + + + + number + + + + + + + + + + + + + +

49

+ + + + + + + + TECHNIC_MEDIUM_HUB_GEST_SENSOR + + + + + + + number + + + + + + + + + + + + + +

54

+ + + + + + + + REMOTE_CONTROL_BUTTON @@ -2774,7 +2890,7 @@ - RSSI + REMOTE_CONTROL_RSSI @@ -2803,7 +2919,36 @@ - CONTROL_PLUS_ACCELEROMETER + TECHNIC_MEDIUM_HUB_ACCELEROMETER + + + + + + + number + + + + + + + + + + + + + +

57

+ + + + + + + + TECHNIC_MEDIUM_HUB_GYRO_SENSOR @@ -2832,7 +2977,7 @@ - CONTROL_PLUS_TILT + TECHNIC_MEDIUM_HUB_TILT_SENSOR @@ -2858,6 +3003,325 @@ + + + + TECHNIC_MEDIUM_HUB_TEMPERATURE_SENSOR + + + + + + + number + + + + + + + + + + + + + +

60

+ + + + + + + + TECHNIC_COLOR_SENSOR + + + + + + + number + + + + + + + + + + + + + +

61

+ + + + + + + + TECHNIC_DISTANCE_SENSOR + + + + + + + number + + + + + + + + + + + + + +

62

+ + + + + + + + TECHNIC_FORCE_SENSOR + + + + + + + number + + + + + + + + + + + + + +

63

+ + + + + + + + TECHNIC_3X3_COLOR_LIGHT_MATRIX + + + + + + + number + + + + + + + + + + + + + +

64

+ + + + + + + + TECHNIC_SMALL_ANGULAR_MOTOR + + + + + + + number + + + + + + + + + + + + + +

65

+ + + + + + + + MARIO_ACCELEROMETER + + + + + + + number + + + + + + + + + + + + + +

71

+ + + + + + + + MARIO_BARCODE_SENSOR + + + + + + + number + + + + + + + + + + + + + +

73

+ + + + + + + + MARIO_PANTS_SENSOR + + + + + + + number + + + + + + + + + + + + + +

74

+ + + + + + + + TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY + + + + + + + number + + + + + + + + + + + + + +

75

+ + + + + + + + TECHNIC_LARGE_ANGULAR_MOTOR_GREY + + + + + + + number + + + + + + + + + + + + + +

76

+ + + + @@ -2895,7 +3359,7 @@
@@ -3156,7 +3620,7 @@
@@ -3505,7 +3969,7 @@
@@ -3709,7 +4173,7 @@
@@ -4000,7 +4464,7 @@
@@ -4552,7 +5016,7 @@
@@ -5104,7 +5568,7 @@
@@ -5273,7 +5737,7 @@ - POWERED_UP_HUB + HUB @@ -5302,7 +5766,7 @@ - POWERED_UP_REMOTE + REMOTE_CONTROL @@ -5331,7 +5795,7 @@ - DUPLO_TRAIN_HUB + DUPLO_TRAIN_BASE @@ -5360,7 +5824,7 @@ - CONTROL_PLUS_HUB + TECHNIC_MEDIUM_HUB @@ -5415,6 +5879,35 @@ + + + + TECHNIC_SMALL_HUB + + + + + + + number + + + + + + + + + + + + + +

8

+ + + + @@ -5946,7 +6439,7 @@
@@ -6324,7 +6817,7 @@
@@ -6644,7 +7137,7 @@
@@ -7167,7 +7660,7 @@
@@ -7512,7 +8005,7 @@
@@ -7799,7 +8292,7 @@
@@ -8586,7 +9079,7 @@
@@ -8993,7 +9486,7 @@
@@ -9284,7 +9777,7 @@
diff --git a/docs/hubs_basehub.js.html b/docs/hubs_basehub.js.html index 8c7fa9c..1e617a9 100644 --- a/docs/hubs_basehub.js.html +++ b/docs/hubs_basehub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_duplotrainbase.js.html b/docs/hubs_duplotrainbase.js.html index def8ab3..ef7fe38 100644 --- a/docs/hubs_duplotrainbase.js.html +++ b/docs/hubs_duplotrainbase.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_hub.js.html b/docs/hubs_hub.js.html index 4500239..d77b109 100644 --- a/docs/hubs_hub.js.html +++ b/docs/hubs_hub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_lpf2hub.js.html b/docs/hubs_lpf2hub.js.html index 6623151..64b2d36 100644 --- a/docs/hubs_lpf2hub.js.html +++ b/docs/hubs_lpf2hub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_mario.js.html b/docs/hubs_mario.js.html index ea2a732..eee09db 100644 --- a/docs/hubs_mario.js.html +++ b/docs/hubs_mario.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_movehub.js.html b/docs/hubs_movehub.js.html index 7ccd4f0..ecdb49c 100644 --- a/docs/hubs_movehub.js.html +++ b/docs/hubs_movehub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_remotecontrol.js.html b/docs/hubs_remotecontrol.js.html index ee570bf..0475be4 100644 --- a/docs/hubs_remotecontrol.js.html +++ b/docs/hubs_remotecontrol.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_technicmediumhub.js.html b/docs/hubs_technicmediumhub.js.html index 18cc7ef..31937ab 100644 --- a/docs/hubs_technicmediumhub.js.html +++ b/docs/hubs_technicmediumhub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_technicsmallhub.js.html b/docs/hubs_technicsmallhub.js.html index d8afa1f..83e9775 100644 --- a/docs/hubs_technicsmallhub.js.html +++ b/docs/hubs_technicsmallhub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/hubs_wedo2smarthub.js.html b/docs/hubs_wedo2smarthub.js.html index e4965ab..a71b7b9 100644 --- a/docs/hubs_wedo2smarthub.js.html +++ b/docs/hubs_wedo2smarthub.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/index.html b/docs/index.html index e9ec68f..c7b71f0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@ -

Classes

+

Classes

diff --git a/docs/poweredup-browser.js.html b/docs/poweredup-browser.js.html index bb0fff2..a8daf89 100644 --- a/docs/poweredup-browser.js.html +++ b/docs/poweredup-browser.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

diff --git a/docs/poweredup-node.js.html b/docs/poweredup-node.js.html index 2e44824..932e7f6 100644 --- a/docs/poweredup-node.js.html +++ b/docs/poweredup-node.js.html @@ -75,7 +75,7 @@ -

Classes

+

Classes

@@ -91,6 +91,25 @@
"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.PoweredUP = void 0;
 const nobleabstraction_1 = require("./nobleabstraction");
@@ -101,6 +120,7 @@ const movehub_1 = require("./hubs/movehub");
 const remotecontrol_1 = require("./hubs/remotecontrol");
 const technicmediumhub_1 = require("./hubs/technicmediumhub");
 const wedo2smarthub_1 = require("./hubs/wedo2smarthub");
+const Consts = __importStar(require("./consts"));
 const events_1 = require("events");
 const Debug = require("debug");
 const debug = Debug("poweredup");
@@ -110,7 +130,10 @@ let ready = false;
 let wantScan = false;
 let discoveryEventAttached = false;
 const startScanning = () => {
-    noble.startScanning();
+    noble.startScanning([
+        Consts.BLEService.LPF2_HUB,
+        Consts.BLEService.WEDO2_SMART_HUB
+    ]);
 };
 noble.on("stateChange", (state) => {
     ready = (state === "poweredOn");