-
new AbsoluteMotor()
- - --
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/absolutemotor.js, - line 26 - -
-
-
-
-
-
-
-
-
Extends
- - + + + +-
-
- TachoMotor +
- + + + + + + + + + +
+ AbsoluteMotor +
+ + ++ + AbsoluteMotor + +
+ +Methods
+ --
-
-
-
-
gotoAngle(angle [, speed])
- - -
- -
+
+
+
+
+
+ new AbsoluteMotor() +
+ - --+ +Rotate a motor by a given angle.
+ + + + + + + + + + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/absolutemotor.js, line 26 + +
+
+
+
+
+
+
+
+
Extends
+ + + + +-
+
- TachoMotor +
Parameters:
+ + + + +Methods
+ + -- + + + + + + + +
+ gotoAngle(angle, speedopt) → {Promise} +
+ + + + + + +++ + + + + + + +Rotate a motor by a given angle.
+Parameters:
+ + ++
- - + + +- + + + + + +Name - + -Type +Type - -Argument - + +Attributes + - +Default + + +Description ++ + - - - - - - -angle
Description -+ + + number + -+ - - - -angle
- - -number - - - - - - - -- - - - - - - - - -- - - - - -Absolute position the motor should go to (degrees from 0).
- - + + + + + + - -speed
- - -number + + - - - - - - -- - <optional> + +
- - - - - -- - - 100 - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
+ + + + ++ + - +Absolute position the motor should go to (degrees from 0).
+ ++ + + + + + + +speed
+ + + + number + + + + + + + + + ++ + <optional> + + + +
+ + + + + ++ + 100 + + + + ++ +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/absolutemotor.js, - line 52 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/absolutemotor.js, line 52 + +
+
+
+
+
+
+
+
-- -
-gotoRealZero( [speed])
- - -- + - -
-- - - - -Rotate motor to real zero position.
+ + + + ++ gotoRealZero(speedopt) → {Promise} +
+ + + + + + ++- +Rotate motor to real zero position.
Real zero is marked on Technic angular motors (SPIKE Prime). It is also available on Technic linear motors (Control+) but is unmarked.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + + + + + +Name - + -Type +Type - -Argument - + +Attributes + - +Default + + +Description ++ + - + -speed
Description -+ + + + number + - -+ + + + + + + + + + + +- - - -speed
- - -number - - - - - - - -- - <optional> + <optional>
- - - - - -
-- - 100 - - - - -Speed between 1 - 100. Note that this will always take the shortest path to zero.
+ + 100 + + + + ++ + - +Speed between 1 - 100. Note that this will always take the shortest path to zero.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/absolutemotor.js, - line 87 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/absolutemotor.js, line 87 + +
+
+
+
+
+
+
+
-- -
-resetZero()
- - -- + + + + + + +
- - -+ resetZero() → {Promise} +
+ + + + + + +++ + + + + - -Reset zero to current position
+-- - - - - -Reset zero to current position
--
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/absolutemotor.js, - line 118 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/absolutemotor.js, line 118 + +
+
+
+
+
+
+
+
-- -
-rotateByDegrees(degrees [, speed])
- - -- + - -
-- + + + + +Rotate a motor by a given amount of degrees.
-+ rotateByDegrees(degrees, speedopt) → {Promise} +
+ - + - - - -Parameters:
- -- +
++ + + + + + + +Rotate a motor by a given amount of degrees.
+Parameters:
+ + ++
- - + + +- + + + + + +Name - + -Type +Type - -Argument - + +Attributes + - +Default + + +Description ++ + - - - - - - -degrees
Description -+ + + number + -+ - - - -degrees
- - -number - - - - - - - -- - - - - - - - - -- - - - - -How much the motor should be rotated (in degrees).
- - + + + + + + - -speed
- - -number + + - - - - - - -- - <optional> + +
- - - - - -- - - 100 - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
+ + + + ++ + - +How much the motor should be rotated (in degrees).
+ ++ + + + + + + +speed
+ + + + number + + + + + + + + + ++ + <optional> + + + +
+ + + + + ++ + 100 + + + + ++ +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
+ +-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#rotateByDegrees - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 138 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + TachoMotor#rotateByDegrees + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 138 + +
+
+
+
+
+
+
+
-- -
-setAccelerationTime(time)
- - -- + - -
-- + + + + +Set the global acceleration time
-+ setAccelerationTime(time) → {Promise} +
+ - + - - - -Parameters:
- -- +
++ + + + + + + +Set the global acceleration time
+Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +time
+ + + + number + - - - + - -time
- - -number + + + + - - - - - - - - -How long acceleration should last (in milliseconds).
+ + - +How long acceleration should last (in milliseconds).
+ +-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#setAccelerationTime - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 73 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + TachoMotor#setAccelerationTime + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 73 + +
+
+
+
+
+
+
+
-- -
-setBrakingStyle(style)
- - -- + - -
-- - - - -Set the braking style of the motor.
+ + + + ++ setBrakingStyle(style) +
+ + + + + + ++- +Set the braking style of the motor.
Note: This applies to setSpeed, rotateByDegrees, and gotoAngle.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +style
+ + + + number + - - - + - -style
- - -number + + + + - - - - - - - - -Either BRAKE or HOLD
+ + - +Either BRAKE or HOLD
+ +-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#setBrakingStyle - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 53 - -
-
-
-
-
-
-
-
-
-- -
-setDecelerationTime(time)
- - -- - - -
-- - - - - - - - -Set the global deceleration time
-Parameters:
- - -- -
- - - - -- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -time
- - -number - - - - - - - - - - - -How long deceleration should last (in milliseconds).
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#setDecelerationTime - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 84 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command (ie. once the motor is finished).
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + TachoMotor#setBrakingStyle + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 53 + +
+
+
+
+
+
+
+
+ setDecelerationTime(time) → {Promise} +
+ + + + + + +++ + + + + + + +Set the global deceleration time
+Parameters:
+ + ++ +
+ + + + + ++ + + + + - - +Name + + +Type + + + + + +Description ++ + + + + + + +time
+ - + + + + + +
-- -
-setMaxPower(style)
- - -- + + number + -
-Set the max power of the motor.
+ + + ++ +How long deceleration should last (in milliseconds).
+ +-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + TachoMotor#setDecelerationTime + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 84 + +
+
+
+
+
+
+
+
+
+ setMaxPower(style) +
+ + + + + + ++- + - - - - -Set the max power of the motor.
Note: This applies to setSpeed, rotateByDegrees, and gotoAngle.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +style
+ + + + number + - - - + - -style
- - -number + + + + - - - - - - - - -Either BRAKE or HOLD
+ + - +Either BRAKE or HOLD
+ +-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#setMaxPower - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 63 - -
-
-
-
-
-
-
-
-
-- -
-setSpeed(speed, time)
- - -- - - -
- - + - + + + + +-- - - - - - - - -Set the motor speed.
-Parameters:
- - -- -
- - - - -- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -speed
- - -number - - - - - - - - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
- - - - - - - - -time
- - -number - - - - - - - - - - - -How long the motor should run for (in milliseconds).
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#setSpeed - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 95 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + TachoMotor#setMaxPower + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 63 + +
+
+
+
+
+
+
+
+ setSpeed(speed, time) → {Promise} +
+ - -Events
- --
-
-
-
-
absolute
- - -
- -
-
-
- -- - - - - -
Emits when a the motors absolute position is changed.
-Type: -object + -
- - - -Parameters:
- ++-Set the motor speed.
+- + + + + + + +
Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +speed
+ + + + number + - - - + - -absolute
- - -number + + + + - - - - - - - -- + + - +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ ++ + + + + + + +time
+ + + + number + + + + + + + + + + + + ++ +How long the motor should run for (in milliseconds).
+ +-
-
-
+
-
+
-
+
+
- Inherited From: +
-
+
-
+
- + TachoMotor#setSpeed + +
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 95 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/absolutemotor.js, - line 39 - -
-
+
-
-
-
-
-
+
Events
- - - - - - - - - - - -
-- -
-rotate
- - -- - - -
-- - - - - -Emits when a rotation sensor is activated.
-Type: -object - - -
- - - - -Parameters:
+ -- + + + + + + + +
+ absolute :object +
+ + + + + + +++ + + + + + + +Emits when a the motors absolute position is changed.
+Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +absolute
+ + + + number + - - - + - -rotation
- - -number + + + + - - - - - - - -- + + + + - +-
-
-
+
-
+
-
-
- Inherited From: -
-
-
-
-
- - TachoMotor#event:rotate - -
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+ - Source: +
-
+
-
+
- + devices/absolutemotor.js, line 39 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/tachomotor.js, - line 43 - -
-
+
-
-
-
-
-
+
+ rotate :object +
+ + + + + + +++ + + + + + + +Emits when a rotation sensor is activated.
+Parameters:
+ + ++ +
+ + + + ++ + + + + +Name + + +Type + + + + + +Description ++ + + + + + +rotation
+ + + + number + - + + + + + + + + ++ + + +-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + TachoMotor#event:rotate + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/tachomotor.js, line 43 + +
+
+
+
+
+
+
+
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/BaseHub.html b/docs/BaseHub.html index fe0ce37..b863014 100644 --- a/docs/BaseHub.html +++ b/docs/BaseHub.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: BaseHub - - + + - ++ BaseHub - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
- + + + + + + + -
-
-
new BaseHub()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new BaseHub() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + hubs/basehub.js, line 59 + +
+
+
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 59 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- EventEmitter -
- EventEmitter +
-
-
<readonly> batteryLevel
- -
- -
-
+
+ (readonly) batteryLevel +
- - --
-
-
- Source: -
-
-
-
-
- - hubs/basehub.js, - line 141 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> firmwareVersion
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - hubs/basehub.js, - line 113 - -
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -batteryLevel
Type ++ + + + number + + + + + + + -Description ++ Battery level of the hub (Percentage between 0-100)
+- - - - - + + - - -firmwareVersion
- - -string - - - - - - - - - - - -Firmware version of the hub
-
-
-
- -
-
<readonly> hardwareVersion
- - -
- -
-
-
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 141 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 120 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> name
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 113 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 92 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> ports
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 120 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 106 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> primaryMACAddress
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 92 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 127 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> rssi
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 106 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 148 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> type
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 127 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 99 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> uuid
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + hubs/basehub.js, line 148 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - hubs/basehub.js, - line 134 - -
-
-
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 99 + +
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + hubs/basehub.js, line 134 + +
+
+
+
+
+
+
+
+ - + + + + + + + -
-
-
new BasicMotor()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new BasicMotor() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/basicmotor.js, line 26 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/basicmotor.js, - line 26 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- Device -
- Device +
-
-
<readonly> connected
- -
- -
-
+
+ (readonly) connected +
- - --
-
-
- Inherited From: -
-
-
-
-
- - Device#connected - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 76 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> hub
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#hub - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 83 - -
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -connected
Type ++ + + + boolean + + + + + + + -Description ++ Check if the device is still attached.
+- - - - - + + - - -hub
- - -Hub - - - - - - - - - - - -The Hub the device is attached to.
-
-
-
- -
-
<readonly> isVirtualPort
- - -
- -
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#isVirtualPort - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 120 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -isVirtualPort
- - -boolean - - - - - - - - - - - -Is this device attached to a virtual port (ie. a combined device)
-
-
-
- -
-
<readonly> mode
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#mode - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 110 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -mode
- - -number - - - - - - - - - - - -The mode the device is currently in
-
-
-
- -
-
<readonly> portName
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#portName - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 93 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -portName
- - -string - - - - - - - - - - - -The port the device is attached to.
-
-
-
- -
-
<readonly> type
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#type - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 100 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -type
- - -number - - - - - - - - - - - -The type of the device
-
-
-
-
-
- -
-
brake()
- - -
- -
-
-
- -- - - - - - - - - - -
Brake the motor.
--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/basicmotor.js, - line 73 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#connected + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 76 + +
+
+
+
+
+
+
+
+
+
+
- -
-
rampPower(fromPower, toPower, time)
- - -
- -
-
- -- +
Ramp the motor power.
-+ (readonly) hub +
- - - - -Parameters:
- -- + + + +
Properties:
+ + + ++
- - + +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +fromPower
+ + + + -hub
- - -number - - - - - - - - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ + + + Hub + - - - - - - - - - -toPower
- - -number + + + + - - ++ +The Hub the device is attached to.
+ - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
- - - - - + + - - -time
- - -number - - - - - - - - - - - -How long the ramp should last (in milliseconds).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/basicmotor.js, - line 46 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful completion of command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#hub + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 83 + +
+
+
+
+
+
+
+
-- -
-setPower(power)
- - -- - -
-- +Set the motor power.
-+ (readonly) isVirtualPort +
- - - - -Parameters:
- -- + + + +
Properties:
+ + + ++
- - + +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +power
+ + + + -isVirtualPort
- - -number - - - - - - - - - - - -For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ + + + boolean + - + + + + + + + + + ++ + + + +Is this device attached to a virtual port (ie. a combined device)
+-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/basicmotor.js, - line 34 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#isVirtualPort + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 120 + +
+
+
+
+
+
+
+
-- -
-stop()
- - -- +
+ (readonly) mode +
+ + + + + + + +Properties:
+ + + ++ +
+ + + -+ + + + + -Name + + +Type + + + + + +Description +-- + +Stop the motor.
-+ + + + + + + + +mode
+ + + + number + - - - + + + + + + + ++ +The mode the device is currently in
+-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/basicmotor.js, - line 64 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#mode + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 110 + +
+
+
+
+
+
+
+
+ (readonly) portName +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +portName
+ + + + string + + + + + + + + - - + - ++ +The port the device is attached to.
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#portName + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 93 + +
+
+
+
+
+
+
+
+
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +type
+ + + + number + + + + + + + + + + + + ++ +The type of the device
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#type + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 100 + +
+
+
+
+
+
+
+
+
Methods
+ + + + + + + + + + + ++ brake() → {Promise} +
+ + + + + + +++ + + + + + + + + + +Brake the motor.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/basicmotor.js, line 73 + +
+
+
+
+
+
+
+
+
+ rampPower(fromPower, toPower, time) → {Promise} +
+ + + + + + +++ + + + + + + +Ramp the motor power.
+Parameters:
+ + ++ +
+ + + + + ++ + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + +fromPower
+ + + + number + + + + + + + + + + + + ++ +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ ++ + + + + + + +toPower
+ + + + number + + + + + + + + + + + + ++ +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ ++ + + + + + + + +time
+ + + + number + + + + + + + + + + + + ++ +How long the ramp should last (in milliseconds).
+ +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/basicmotor.js, line 46 + +
+
+
+
+
+
+
+
+
+ setPower(power) → {Promise} +
+ + + + + + +++ + + + + + + +Set the motor power.
+Parameters:
+ + ++ +
+ + + + + ++ + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +power
+ + + + number + + + + + + + + + + + + ++ +For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
+ +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/basicmotor.js, line 34 + +
+
+
+
+
+
+
+
+
+ stop() → {Promise} +
+ + + + + + +++ + + + + + + + + + +Stop the motor.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/basicmotor.js, line 64 + +
+
+
+
+
+
+
+
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/ColorDistanceSensor.html b/docs/ColorDistanceSensor.html index 346c5bf..b72a85c 100644 --- a/docs/ColorDistanceSensor.html +++ b/docs/ColorDistanceSensor.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: ColorDistanceSensor - - + + - ++ ColorDistanceSensor - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
- + + + + + + + -
-
-
new ColorDistanceSensor()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new ColorDistanceSensor() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 26 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 26 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- Device -
- Device +
-
-
<readonly> connected
- -
- -
-
+
+ (readonly) connected +
- - --
-
-
- Inherited From: -
-
-
-
-
- - Device#connected - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 76 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> hub
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#hub - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 83 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -connected
Type ++ + + + boolean + + + + + + + -Description ++ Check if the device is still attached.
+- - - - - - - - -hub
- - -Hub - - - - - - - - - - - -The Hub the device is attached to.
-
-
-
- -
-
<readonly> isVirtualPort
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#isVirtualPort - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 120 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -isVirtualPort
- - -boolean - - - - - - - - - - - -Is this device attached to a virtual port (ie. a combined device)
-
-
-
- -
-
<readonly> mode
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#mode - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 110 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -mode
- - -number - - - - - - - - - - - -The mode the device is currently in
-
-
-
- -
-
<readonly> portName
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#portName - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 93 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -portName
- - -string - - - - - - - - - - - -The port the device is attached to.
-
-
-
- -
-
<readonly> type
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#type - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 100 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -type
- - -number - - - - - - - - - - - -The type of the device
-
-
-
-
-
- -
-
sendPFIRMessage(message)
- - -
- -
-
-
- -- - - - - - - - -
Send a raw Power Functions IR command
-Parameters:
- - -- -
- - + +- - - - - - - -Name - - -Type - - - - - -Description -- - - - - + + - - -message
- - -Buffer - - - - - - - - - - - -2 byte payload making up a Power Functions protocol command. NOTE: Only specify nibbles 1-3, nibble 4 should be zeroed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 153 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#connected + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 76 + +
+
+
+
+
+
+
+
+
+
+
- -
-
setColor(color)
- - -
- -
-
- -- +
Set the color of the LED on the sensor via a color value.
-+ (readonly) hub +
- - - - -Parameters:
- -- + + + +
Properties:
+ + + ++
- - + +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +color
+ + + + -hub
- - -Color - - - - - - - - - - -- + + + + Hub + - + + + + + + + + + ++ + + + +The Hub the device is attached to.
+-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 171 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + Device#hub + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 83 + +
+
+
+
+
+
+
+
-- -
setPFExtendedChannel(channel)
+ ++ (readonly) isVirtualPort +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + - - -Name + + +Type + + + + + +Description +- + +
++ + + + + + + +isVirtualPort
+ + + + boolean + - + + + + + +-Switches the IR receiver into extended channel mode. After setting this, use channels 5-8 instead of 1-4 for this receiver.
+ + + ++ +Is this device attached to a virtual port (ie. a combined device)
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#isVirtualPort + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 120 + +
+
+
+
+
+
+
+
+
+ (readonly) mode +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +mode
+ + + + number + + + + + + + + + + + + ++ +The mode the device is currently in
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#mode + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 110 + +
+
+
+
+
+
+
+
+
+ (readonly) portName +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +portName
+ + + + string + + + + + + + + + + + + ++ +The port the device is attached to.
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#portName + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 93 + +
+
+
+
+
+
+
+
+
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +type
+ + + + number + + + + + + + + + + + + ++ +The type of the device
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#type + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 100 + +
+
+
+
+
+
+
+
+
Methods
+ + + + + + + + + + + ++ sendPFIRMessage(message) → {Promise} +
+ + + + + + +++ + + + + + + +Send a raw Power Functions IR command
+Parameters:
+ + ++ +
+ + + + + ++ + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +message
+ + + + Buffer + + + + + + + + + + + + ++ +2 byte payload making up a Power Functions protocol command. NOTE: Only specify nibbles 1-3, nibble 4 should be zeroed.
+ +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 153 + +
+
+
+
+
+
+
+
+
+ setColor(color) → {Promise} +
+ + + + + + +++ + + + + + + +Set the color of the LED on the sensor via a color value.
+Parameters:
+ + ++ +
+ + + + + ++ + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +color
+ + + + Color + + + + + + + + + + + + ++ + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 171 + +
+
+
+
+
+
+
+
+
+ setPFExtendedChannel(channel) → {Promise} +
+ + + + + + ++- + - - - - -Switches the IR receiver into extended channel mode. After setting this, use channels 5-8 instead of 1-4 for this receiver.
NOTE: Calling this with channel 5-8 with switch off extended channel mode for this receiver.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +channel
+ + + + number + - - - + - -channel
- - -number + + + + - - - - - - - - -Channel number, between 1-8
+ + - +Channel number, between 1-8
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 91 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 91 + +
+
+
+
+
+
+
+
-- -
-setPFPower(channel, output, power)
- - -- + - -
-- + + + + +Set the power of a Power Functions motor via IR
-+ setPFPower(channel, output, power) → {Promise} +
+ - + - - - -Parameters:
- -- +
++ + + + + + + +Set the power of a Power Functions motor via IR
+Parameters:
+ + ++
- - + + +- + - + - + +Name - + -Type +Type - + - + -Description +Description + + + -channel
+ + + number + -+ - - - -channel
- - -number - - - - - - - - - - - -Channel number, between 1-4
+ + + + + + + + + + + ++ +Channel number, between 1-4
+ ++ + + + string + - + + +output
+ - - - -output
- - -string - - - - - - - - - - - -Outport port, "RED" (A) or "BLUE" (B)
- - + - -power
- - -number + + + + - - - - - - - - -7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
+ + - +Outport port, "RED" (A) or "BLUE" (B)
+ ++ + + + + + + +power
+ + + + number + + + + + + + + + + + + ++ +7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 111 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 111 + +
+
+
+
+
+
+
+
-- -
-startPFMotors(channel, powerA, powerB)
- - -- + - -
-- - - - -Start Power Functions motors running via IR
+ + + + ++ startPFMotors(channel, powerA, powerB) → {Promise} +
+ + + + + + ++- +Start Power Functions motors running via IR
NOTE: This command is designed for bang-bang style operation. To keep the motors running, the sensor needs to be within range of the IR receiver constantly.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + - + - + +Name - + -Type +Type - + - + -Description +Description + + + -channel
+ + + Buffer + -+ - - - -channel
- - -Buffer - - - - - - - - - - - -Channel number, between 1-4
+ + + + + + + + + + + ++ +Channel number, between 1-4
+ ++ + + + Buffer + - + + +powerA
+ - - - -powerA
- - -Buffer - - - - - - - - - - - -7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
- - + - -powerB
- - -Buffer + + + + - - - - - - - - -7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
+ + - +7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
+ ++ + + + + + + +powerB
+ + + + Buffer + + + + + + + + + + + + ++ +7 (full reverse) to 7 (full forward). 0 is stop. 8 is brake.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 131 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of the command.
--
-
- - Type - -
- - -Promise + + + + +
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 131 + +
+
+
+
+
+
+
+
Events
+ + - - - - + - + + + + ++ color :object +
+ - -Events
- --
-
-
-
-
color
- - -
- -
-
-
- -- - - - - -
Emits when a color sensor is activated.
-Type: -object + -
- - - -Parameters:
- ++-Emits when a color sensor is activated.
+- + + + + + + +
Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +color
+ + + + Color + - - - + - -color
- - -Color + + + + - - - - - - - -- + + + + - +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 40 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 40 - -
-
+
-
-
-
-
-
+
-- -
-colorAndDistance
- - -- - - -
-- - - - - -A combined color and distance event, emits when the sensor is activated.
-Type: -object -
- - - -Parameters:
+ + + + + + + + + + -- + + + + + + + +
+ colorAndDistance :object +
+ + + + + + +++ + + + + + + +A combined color and distance event, emits when the sensor is activated.
+Parameters:
+ + ++
- - + + +- + - + - + +Name - + -Type +Type - + - + -Description +Description + + + -color
+ + + Color + -+ - - - -color
- - -Color - - - - - - - - - - -- - - + - -distance
- - -number + + + + - - - - - - - - -Distance, in millimeters.
+ + + + - ++ + + + + + + +distance
+ + + + number + + + + + + + + + + + + ++ +Distance, in millimeters.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 77 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 77 - -
-
+
-
-
-
-
-
+
-- -
-distance
- - -- - - -
-- - - - - -Emits when a distance sensor is activated.
-Type: -object -
- - - -Parameters:
+ + + + + + + + + + -- + + + + + + + +
+ distance :object +
+ + + + + + +++ + + + + + + +Emits when a distance sensor is activated.
+Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +distance
+ + + + number + - - - + - -distance
- - -number + + + + - - - - - - - - -Distance, in millimeters.
+ + - +Distance, in millimeters.
+ +-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/colordistancesensor.js, line 58 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/colordistancesensor.js, - line 58 - -
-
+
-
-
-
-
-
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/CurrentSensor.html b/docs/CurrentSensor.html index 24a95e9..2eb9ecf 100644 --- a/docs/CurrentSensor.html +++ b/docs/CurrentSensor.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: CurrentSensor - - + + - ++ CurrentSensor - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
- + + + + + + + -
-
-
new CurrentSensor()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new CurrentSensor() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/currentsensor.js, line 25 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/currentsensor.js, - line 25 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- Device -
- Device +
-
-
<readonly> connected
- -
- -
-
+
+ (readonly) connected +
- - --
-
-
- Inherited From: -
-
-
-
-
- - Device#connected - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 76 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> hub
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#hub - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 83 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -connected
Type ++ + + + boolean + + + + + + + -Description ++ Check if the device is still attached.
+- - - - - - - - -hub
- - -Hub - - - - - - - - - - - -The Hub the device is attached to.
-
-
-
- -
-
<readonly> isVirtualPort
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#isVirtualPort - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 120 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -isVirtualPort
- - -boolean - - - - - - - - - - - -Is this device attached to a virtual port (ie. a combined device)
-
-
-
- -
-
<readonly> mode
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#mode - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 110 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -mode
- - -number - - - - - - - - - - - -The mode the device is currently in
-
-
-
- -
-
<readonly> portName
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#portName - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 93 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -portName
- - -string - - - - - - - - - - - -The port the device is attached to.
-
-
-
- -
-
<readonly> type
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - Device#type - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 100 - -
-
-
-
-
-
-
-
-
Properties:
- --
-
-
- -
-- - - - - - - -Name - - -Type - - - - - -Description -- - - - - - - - -type
- - -number - - - - - - - - - - - -The type of the device
-
-
-
-
-
-
-
-
-
- -
-
current
- - -
- -
-
-
- -- - - - - -
Emits when a current change is detected.
-Type: -object - - -
- - - - -Parameters:
- - -- -
- - + +- - - - - - - -Name - - -Type - - - - - -Description -- - - - - + + - - -current
- - -number - - - - - - - - - - -- -
-
-
+
-
+
-
+
+
- Inherited From: +
-
+
-
+
- + Device#connected + +
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 76 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/currentsensor.js, - line 51 - -
-
+
-
-
-
-
-
+
+ (readonly) hub +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +hub
+ + + + Hub + + + + + + + + + + + + ++ +The Hub the device is attached to.
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#hub + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 83 + +
+
+
+
+
+
+
+
+
+ (readonly) isVirtualPort +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +isVirtualPort
+ + + + boolean + + + + + + + + + + + + ++ +Is this device attached to a virtual port (ie. a combined device)
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#isVirtualPort + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 120 + +
+
+
+
+
+
+
+
+
+ (readonly) mode +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +mode
+ + + + number + + + + + + + + + + + + ++ +The mode the device is currently in
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#mode + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 110 + +
+
+
+
+
+
+
+
+
+ (readonly) portName +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +portName
+ + + + string + + + + + + + + + + + + ++ +The port the device is attached to.
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#portName + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 93 + +
+
+
+
+
+
+
+
+
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +type
+ + + + number + + + + + + + + + + + + ++ +The type of the device
+-
+
+
+
+
+
+
+
- Inherited From: +
-
+
-
+
- + Device#type + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + devices/device.js, line 100 + +
+
+
+
+
+
+
+
+
Events
+ + + + + + + + + + + ++ current :object +
+ + + + + + +++ + + + + + + +Emits when a current change is detected.
+Parameters:
+ + ++ +
-+ + + + + + +Name + + +Type + + + + + +Description ++ + - + + + + +current
+ + + + number + - + + + + + + + + ++ + + + - Source: +
-
+
-
+
- + devices/currentsensor.js, line 51 + +
+
+
+
+
+
+
+
+ - + + + + + + + -
-
-
new Device()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new Device() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + devices/device.js, line 25 + +
+
+
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 25 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- EventEmitter -
- EventEmitter +
-
-
<readonly> connected
- -
- -
-
+
+ (readonly) connected +
- - --
-
-
- Source: -
-
-
-
-
- - devices/device.js, - line 76 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> hub
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Source: -
-
-
-
-
- - devices/device.js, - line 83 - -
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -connected
Type ++ + + + boolean + + + + + + + -Description ++ Check if the device is still attached.
+- - - - - + + - - -hub
- - -Hub - - - - - - - - - - - -The Hub the device is attached to.
-
-
-
- -
-
<readonly> isVirtualPort
- - -
- -
-
-
-
-
-
-
-
-
- Source: +
-
+
-
+
- + devices/device.js, line 76 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - devices/device.js, - line 120 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> mode
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + devices/device.js, line 83 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - devices/device.js, - line 110 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> portName
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + devices/device.js, line 120 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - devices/device.js, - line 93 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> type
+ -
-
-
-
-
-
-
- Source: +
-
+
-
+
- + devices/device.js, line 110 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: -
-
-
-
-
- - devices/device.js, - line 100 - -
-
-
+ - Source: +
-
+
-
+
- + devices/device.js, line 93 + +
+
+
+
+
+
+
+
- Source: +
-
+
-
+
- + devices/device.js, line 100 + +
+
+
+
+
+
+
+
+ - + + + + + + + -
-
-
new DuploTrainBase()
- - -
- -
-
- -- - + + + + + + +
The DuploTrainBase is emitted if the discovered device is a Duplo Train Base.
-+ new DuploTrainBase() +
+ + + + + + +++ + + + + + + - - - -The DuploTrainBase is emitted if the discovered device is a Duplo Train Base.
+-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
-
+
-
+
- + hubs/duplotrainbase.js, line 27 + +
+
+
-
- - Source: -
-
-
-
-
- - hubs/duplotrainbase.js, - line 27 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
-
-
<readonly> batteryLevel
- -
- -
-
+
+ (readonly) batteryLevel +
- - --
-
-
- Inherited From: -
-
-
-
-
- - BaseHub#batteryLevel - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 141 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> firmwareVersion
- - -
- -
-
-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - BaseHub#firmwareVersion - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 113 - -
-
-
-
-
-
-
-
Properties:
- --
-
-
-
-- - - - - - -Name - + + + -batteryLevel
Type ++ + + + number + + + + + + + -Description ++ Battery level of the hub (Percentage between 0-100)
+- - - - - + + - - -firmwareVersion
- - -string - - - - - - - - - - - -Firmware version of the hub
-
-
-
- -
-
<readonly> hardwareVersion
- - -
- -
-
-
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#batteryLevel + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 141 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#hardwareVersion - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 120 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> name
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#firmwareVersion + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 113 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#name - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 92 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> ports
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#hardwareVersion + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 120 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#ports - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 106 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> primaryMACAddress
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#name + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 92 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#primaryMACAddress - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 127 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> rssi
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#ports + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 106 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#rssi - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 148 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> type
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#primaryMACAddress + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 127 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#type - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 99 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> uuid
+ -
-
-
-
-
-
-
- Inherited From: +
-
+
-
+
- + BaseHub#rssi + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 148 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - BaseHub#uuid - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/basehub.js, - line 134 - -
-
-
+ - Inherited From: +
-
+
-
+
- + BaseHub#type + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 99 + +
+
+
+
+
+
+
+
-
-
createVirtualPort(firstPortName, secondPortName)
+ ++ (readonly) uuid +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + - - -Name + + +Type + + + + + +Description +- + +
++ + + + + + + +uuid
+ + + + string + - + + + + + +-Combines two ports with into a single virtual port.
+ + + ++ +UUID of the hub
+ - + +
- Inherited From: +
-
+
-
+
- + BaseHub#uuid + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/basehub.js, line 134 + +
+
+
+
+
+
+
+
+ - Inherited From: -
-
-
-
-
- - LPF2Hub#createVirtualPort - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/lpf2hub.js, - line 90 - -
-
-
-
-
-
-
-
- - - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + LPF2Hub#createVirtualPort + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/lpf2hub.js, line 90 + +
+
+
+
+
+
+
+
-
-
setName(name)
- - -
- -
+
-
- -- + + + + +
Set the name of the Hub.
-+ setName(name) → {Promise} +
+ - + - - - -Parameters:
- -- +
++ + + + + + + +Set the name of the Hub.
+Parameters:
+ + ++
- - + + +- + - + + + + +Name - + -Type +Type - + - + -Description +Description + + - + + +name
+ + + + string + - - - + - -name
- - -string + + + + - - - - - - - - -New name of the hub (14 characters or less, ASCII only).
+ + - +New name of the hub (14 characters or less, ASCII only).
+ +-
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - LPF2Hub#setName - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/lpf2hub.js, - line 61 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of command.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + LPF2Hub#setName + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/lpf2hub.js, line 61 + +
+
+
+
+
+
+
+
-- -
-shutdown()
- - -- + + + + + + +
- - + - + + + + ++ shutdown() → {Promise} +
+ + + + + + +++ + + + + - -Shutdown the Hub.
+-- - - - - -Shutdown the Hub.
--
-
-
-
-
-
-
-
-
- Inherited From: -
-
-
-
-
- - LPF2Hub#shutdown - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - hubs/lpf2hub.js, - line 53 - -
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful disconnect.
--
-
- - Type - -
- - -Promise + + + +
- Inherited From: +
-
+
-
+
- + LPF2Hub#shutdown + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source: +
-
+
-
+
- + hubs/lpf2hub.js, line 53 + +
+
+
+
+
+
+
+
Events
+ + - -+ button +
+ - -Events
+ --
-
-
-
-
button
- - -
- -
-
- -- - +
Emits when a button is pressed.
-+- - - -Emits when a button is pressed.
+Parameters:
- -- + + + + +
Parameters:
+ + ++
- - + + +- + - + - + +Name - + -Type +Type - + - + -Description +Description + + + -button
+ + + string + -+ - - - -button
- - -string - - - - - - - - - - -- - - + - -state
- - -ButtonState + + + + - - - - - - - -- + + + + - ++ + + + + + + +state
+ + + + ButtonState + + + + + + + + + + + + ++ + + +-
-
-
+
-
+
-
-
- Inherited From: -
-
-
-
-
- - LPF2Hub#event:button - -
-
+
+ - Inherited From: +
-
+
-
+
- + LPF2Hub#event:button + +
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+ - Source: +
-
+
-
+
- + hubs/lpf2hub.js, line 182 + +
+
+
-
- - Source: -
-
-
-
-
- - hubs/lpf2hub.js, - line 182 - -
-
+
-
-
-
-
-
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/DuploTrainBaseColorSensor.html b/docs/DuploTrainBaseColorSensor.html index c983960..bd1eaf7 100644 --- a/docs/DuploTrainBaseColorSensor.html +++ b/docs/DuploTrainBaseColorSensor.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: DuploTrainBaseColorSensor - - + + - ++ DuploTrainBaseColorSensor - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
- + + + + + + + -
-
-
new DuploTrainBaseColorSensor()
- - -
- -
-
-
+
+
+
+
+
+
+
+ new DuploTrainBaseColorSensor() +
+ + + + + + + + + + + + - - - --
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
- Source: +
- + + + + - -
- Source: -
-
-
-
-
- - devices/duplotrainbasecolorsensor.js, - line 26 - -
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
- Device -
- Device +
-
-
<readonly> connected
- -
- -
-
+
+ (readonly) connected +
- - --
-
-
- Inherited From: -
-
-
-
-
- - Device#connected - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source: -
-
-
-
-
- - devices/device.js, - line 76 - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
<readonly> hub
- - -
- -
-
-
-
-
-
-
-
-
-
-
Properties:
- --
-
-
-
- - Name - + +
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -connected
- - -boolean - - - - - - - - - - - -Check if the device is still attached.
-
-+ - -- -- + +-Class: DuploTrainBaseColorSensor
-+ + + + +DuploTrainBaseColorSensor - - +
- + -+ + + + + ++ + DuploTrainBaseColorSensor + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
-
Properties:
+ --
+
-
- + +
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +uuid
+ + + + -type
- - -string - - - - - - - - - - - -UUID of the hub
+ + + + string + - + + + + + + + + + ++ + + + +Hub type
+-
-
+
-
+
+
+
+
Methods
--
+
+
+
-
--
+
+
+
+
+
+
+
Methods
+ + + + + + + + + + + ++ createVirtualPort(firstPortName, secondPortName) → {Promise} +
+ + + + + + ++- + - - - - -Combines two ports with into a single virtual port.
Note: The devices attached to the ports must be of the same device type.
-Parameters:
- -- + + + +
Parameters:
+ + ++
- - + + +- + - + - + +Name - + -Type +Type - + - + -Description +Description + + + -firstPortName
+ + + string + -+ - - - -firstPortName
- - -string - - - - - - - - - - - -First port name
- - + - -secondPortName
- - -string + + + + - - - - - - - - -Second port name
+ + - +First port name
+ ++ + + + + + + +secondPortName
+ + + + string + + + + + + + + + + + + ++ +Second port name
+ +-
-
-
-
-
-
-
-
-
Returns:
- - --- - - -Resolved upon successful issuance of command.
--
-
-
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) rssi +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +type
+ + - - - - + -rssi
- - -string - - - - - - - - - - - -Hub type
+ + + + number + - - - - - - + + + + + +
-+ + + + + +Signal strength of the hub
+
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) primaryMACAddress +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +rssi
+ + - - - - + -primaryMACAddress
- - -number - - - - - - - - - - - -Signal strength of the hub
+ + + + string + - - - - - - + + + + + +
-+ + + + + +Primary MAC address of the hub
+
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) ports +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +primaryMACAddress
+ + - - - - + -ports
- - -string - - - - - - - - - - - -Primary MAC address of the hub
+ + + + Array.<string> + - - - - - - + + + + + +
-+ + + + + +Array of port names
+
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) name +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +ports
+ + - - - - + -name
- - -Array.<string> - - - - - - - - - - - -Array of port names
+ + + + string + - - - - - - + + + + + +
-+ + + + + +Name of the hub
+
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) hardwareVersion +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +name
+ + - - - - + -hardwareVersion
- - -string - - - - - - - - - - - -Name of the hub
+ + + + string + - - - - - - + + + + + +
-+ + + + + +Hardware version of the hub
+
Properties:
+ --
+
-
- + +
+ - - -+ (readonly) firmwareVersion +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +hardwareVersion
+ + - - - - + -firmwareVersion
- - -string - - - - - - - - - - - -Hardware version of the hub
+ + + + string + - - - - - - + + + + + +
-+ + + + + +Firmware version of the hub
+
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -batteryLevel
- - -number - - - - - - - - - - - -Battery level of the hub (Percentage between 0-100)
-
-
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ (readonly) portName +
+ + + + + + + +Properties:
+ + + ++
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +type
+ + + + -portName
- - -number - - - - - - - - - - - -The type of the device
+ + + + string + - + + + + + + + + + ++ + + + +The port the device is attached to.
+-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +type
+ + + + number + + + + + + + + + + + + ++ +The type of the device
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/DuploTrainBase.html b/docs/DuploTrainBase.html index f9cb8ae..4b53d0f 100644 --- a/docs/DuploTrainBase.html +++ b/docs/DuploTrainBase.html @@ -1,194 +1,210 @@ - - - --- -node-poweredup Class: DuploTrainBase - - + + - ++ DuploTrainBase - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
-+ - -- -- + +-Class: DuploTrainBase
-+ + + + +DuploTrainBase - - +
- + -+ + + + + ++ + DuploTrainBase + +
+ + + +- + --
-Extends
+Extends
- + - + @@ -197,1977 +213,1841 @@ - +Members
--
+
-
-
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) mode +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +portName
+ + - - - - + -mode
- - -string - - - - - - - - - - - -The port the device is attached to.
+ + + + number + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +The mode the device is currently in
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) isVirtualPort +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +mode
+ + - - - - + -isVirtualPort
- - -number - - - - - - - - - - - -The mode the device is currently in
+ + + + boolean + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Is this device attached to a virtual port (ie. a combined device)
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) hub +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +isVirtualPort
+ + - - - - + -hub
- - -boolean - - - - - - - - - - - -Is this device attached to a virtual port (ie. a combined device)
+ + + + Hub + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +The Hub the device is attached to.
+
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -connected
- - -boolean - - - - - - - - - - - -Check if the device is still attached.
-
-
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -connected
- - -boolean - - - - - - - - - - - -Check if the device is still attached.
-
-
-
-
-Events
- --
-
-
--
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/Device.html b/docs/Device.html index 4e57b4d..b884bbb 100644 --- a/docs/Device.html +++ b/docs/Device.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: Device - - + + - ++ Device - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
-+ - -- -- + +-Class: Device
-+ + + + +Device - - +
- + -+ + + + + ++ + Device + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
-+ - -- -- + +-Class: CurrentSensor
-+ + + + +CurrentSensor - - +
- + -+ + + + + ++ + CurrentSensor + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
-
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -connected
- - -boolean - - - - - - - - - - - -Check if the device is still attached.
-
-
-
-
-Methods
- --
-
-
-
-
-+ - -- -- + +-Class: ColorDistanceSensor
-+ + + + +ColorDistanceSensor - - +
- + -+ + + + + ++ + ColorDistanceSensor + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -connected
- - -boolean - - - - - - - - - - - -Check if the device is still attached.
-
-
-
-
-Methods
- --
-
-
-
-
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ (readonly) type +
+ + + + + + + +Properties:
+ + + ++
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +uuid
+ + + + -type
- - -string - - - - - - - - - - - -UUID of the hub
+ + + + string + - + + + + + + + + + ++ + + + +Hub type
+-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (readonly) uuid +
+ + + + + + + +Properties:
+ + + ++ +
+ + + + ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +uuid
+ + + + string + + + + + + + + + + + + ++ +UUID of the hub
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- -- -- + - - - - --- - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file diff --git a/docs/BasicMotor.html b/docs/BasicMotor.html index 753c786..a21cfee 100644 --- a/docs/BasicMotor.html +++ b/docs/BasicMotor.html @@ -1,188 +1,204 @@ - - - --- -node-poweredup Class: BasicMotor - - + + - ++ BasicMotor - Documentation + + + + + + + + + + + + + + + + + + - + ++-
+
-+ - -- -- + +-Class: BasicMotor
-+ + + + +BasicMotor - - +
- + -+ + + + + ++ + BasicMotor + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) rssi +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +type
+ + - - - - + -rssi
- - -string - - - - - - - - - - - -Hub type
+ + + + number + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Signal strength of the hub
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) primaryMACAddress +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +rssi
+ + - - - - + -primaryMACAddress
- - -number - - - - - - - - - - - -Signal strength of the hub
+ + + + string + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Primary MAC address of the hub
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) ports +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +primaryMACAddress
+ + - - - - + -ports
- - -string - - - - - - - - - - - -Primary MAC address of the hub
+ + + + Array.<string> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Array of port names
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) name +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +ports
+ + - - - - + -name
- - -Array.<string> - - - - - - - - - - - -Array of port names
+ + + + string + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Name of the hub
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) hardwareVersion +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +name
+ + - - - - + -hardwareVersion
- - -string - - - - - - - - - - - -Name of the hub
+ + + + string + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Hardware version of the hub
+
Properties:
+ --
+
-
- + + + + + + + + + + + + + + + + + + + + + +
+ - - -+ (readonly) firmwareVersion +
+ + + + + + + +Properties:
+ + + ++
- +- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - +hardwareVersion
+ + - - - - + -firmwareVersion
- - -string - - - - - - - - - - - -Hardware version of the hub
+ + + + string + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
-+ + + + + +Firmware version of the hub
+
Properties:
--
-
- + + +
Properties:
+ + + ++
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- + - + - + -Name - + -Type +Type - + - + -Description +Description - - - - - - - - -batteryLevel
- - -number - - - - - - - - - - - -Battery level of the hub (Percentage between 0-100)
-
-
-+ - -- -- + +-Class: BaseHub
-+ + + + +BaseHub - - +
- + -+ + + + + ++ + BaseHub + +
+ + + +- + --
-Extends
+Extends
- + --
-
-
+
Members
--
+
-
-
-
-