0.1.0The Boost instance scans for Boost devices like your movehub.
Extends EventEmitter
(string)
The UUID or MAC address of the movehub to connect to.
(Hub)
The hub that just connected.
Movehub implementation that handles all the sending and receiving of messages between us and the Movehub device.
Extends EventEmitter
MAC Address of connected Movehub.
UUID of connected Movehub.
Tries connecting to initialized Movehub.
Sends disconnection signal and disconnects from Movehub.
Sends SwitchOff signal to Movehub.
Sends signal to immediately shut down Movehub.
Sends given device message to connected Movehub.
(DeviceMessage)
Message to send.
(function
= null)
Called when a Movehub sends a message.
(DeviceMessage)
Fires when an error is received when connecting to the Movehub.
(Error)
Fires when a Movehub gets disconnected.
Fires when new RSSI value is received from BLE device.
(number)
The received RSSI value.
Fires when a connection to the Move Hub is established.
Fires on received Hub Alert.
(any)
{string} String representation of HubAlert that happened.
Interface to work with your R2D2 robot.
Sets color of RGB to given index color.
Promise<void>:
Starts both wheels synchronous using given speed.
(number)
Speed ranging from 0 to 100 (%).
Promise<void>:
Starts both wheels synchronous using given speed until the traveled the given distance.
(number)
Number of centimeters until wheels stop.
(number)
Speed ranging from 0 to 100 (%).
Promise<void>:
Starts both wheels synchronous using given speed for given amount of time.
(number)
Number of milliseconds until wheels stop.
(number)
Speed ranging from 0 to 100 (%).
Promise<void>:
Stop both wheels.
Promise<void>:
Resolves telling if the legs are behind the body of R2D2.
Promise<boolean>:
Speeds up the wheels for a short amount of time, so the force will bring R2D2’s body in front of his legs.
Promise<void>:
Resolves when the movement is done.
TODO: Brings the legs close to R2D2’s body.
Promise<void>:
Resolves when the movement is done.
Starts turning the head.
(number)
The speed ranging from -100 to 100 (%). (Clockwise or counter-clockwise)
Promise<void>:
Resolves immediately.
Stops turning the head.
Promise<void>:
Resolves immediately.
Starts turning the head for given amount of degrees.
(number)
The amount of degrees to turn. Can be positive or negative for clockwise and counter-clockwise movement.
(number)
The speed ranging from 0 to 100 (%).
Promise<void>:
Resolves after movement finishes.
Starts turning the head for given amount of milliseconds.
Promise<void>:
Resolves after movement finishes.
Creates an instance of a DeviceMessage implementation
(Buffer)
(DeviceMessage | UnknownMessage):
Returns an instance of DeviceMessage subclass, or null if message type is unknown to us
Base class for all Messages being send to or received from the MoveHub.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#message-types
(Buffer)
Received Buffer data.
GenericError received from theMoveHub.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#generic-error-messages
Extends DeviceMessage
Up- & Downstream messages for control actions on connected Hub.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-actions
Extends DeviceMessage
HubAlert Messages from MoveHub.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-alerts
TODO: Test receiving them
Extends DeviceMessage
Returns string representation of alert type.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#hub-attached-i-o.
Example data: <Buffer 0f 00 04 00 01 27 00 00 00 00 10 00 00 00 10>
Extends DeviceMessage
Upstream message as answer to PortInputFormatSetup message.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-input-format-single
Extends DeviceMessage
(...any)
Downstream message to setup receiving single value sensor updates
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-input-format-setup-single
Extends PortInputFormat
(...any)
Instantiates a proper PortInputFormatSetup to send to Hub
(number)
Port ID to subscribe updates for
PortInputFormatSetup:
Downstream message to make peripherals do something.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-output-command
Extends DeviceMessage
Message that holds values for multiple ports.
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-value-single
Extends DeviceMessage
As defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-value-single
Example: <Buffer 06 00 45 3a 00 a6>
Extends DeviceMessage
Creates an instance of a Peripheral implementation
(Peripheral | UnknownPeripheral):
Returns an instance of DeviceMessage subclass, or null if message type is unknown to us
This handles the communication with the internal current sensor of Movehub. The values it produces are in milliamperes.
Extends Peripheral
Receives and processes message with value from sensor.
(PortValueSingleMessage)
Defines methods for internal and external Methods of a Movehub.
Extends Peripheral
(Number)
Peripheral Device Type ID (Either
Peripheral.DEV_MOTOR
,
Peripheral.DEV_MOTOR_EXTERNAL_TACHO
or
Peripheral.DEV_MOTOR_INTERNAL_TACHO
)
(Number)
Port ID this peripheral is connected to
(any
= undefined)
Just starts/stops the motor. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startpower-power FIXME: 0 gives a piezo sound, so I guess that is not totally correct
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
Just starts/stops the motor. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeed-speed-maxpower-useprofile-0x07 FIXME: 0 gives a piezo sound, so I guess that is not totally correct
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number?
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Starts the motor for given amount of time. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeedfortime-time-speed-maxpower-endstate-useprofile-0x09
(number)
[0..2^15]
milliseconds
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Turns the motor for given number of degrees Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeedfordegrees-degrees-speed-maxpower-endstate-useprofile-0x0b
(number)
[0..2^31]
milliseconds
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Creates stops message for motor.
Just starts/stops the motor. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeed-speed-maxpower-useprofile-0x07 FIXME: 0 gives a piezo sound, so I guess that is not totally correct
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop for primary motor
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop for secondary motor
(number
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Just starts/stops two motor in synchronized mode. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startpower-power
TODO: This does not work yet
Starts two motors for given amount of time. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeedfortime-time-speed-maxpower-endstate-useprofile-0x0a
TODO: Does not work yet
(number)
[0..2^15]
milliseconds
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Turns two motors in sync for given number of degrees Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-startspeedfordegrees-degrees-speedl-speedr-maxpower-endstate-useprofile-0x0c
(number)
[0..2^31]
milliseconds
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number)
[-100..-1]
Percentage CCW,
[1..100]
Percentage CW,
[0]
to stop
(number
= 100)
[0..100]
%
(number
= Motor.PROFILE_ACCELERATION|Motor.PROFILE_DEACCELERATION)
Bitlist containing profiles to use (Select from
Motor.PROFILE_*
, defaults to
Motor.PROFILE_ACCELERATION | Motor.PROFILE_DEACCELERATION
)
Creates stops message for motor.
Receives and processes message with value from sensor.
(PortValueSingleMessage)
Fires when Motor starts running.
Fires when Motor finished running.
This is the base class for all the peripherals of an Movehub.
Extends EventEmitter
Defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#io-type-id
Disable from all updates from hub.
Handle acknowledge message for prior subscribe or unsubscribe.
(PortInputFormat)
Async method to get the current value. If no value was received yet, it waits for a value to be received before resolving.
Fires when a new value is set on a Peripheral.
(number)
Fires when a new value is set on a Peripheral.
(number)
Class to set LED colors of the Movehub.
Extends Peripheral
Creates a message that sets color to specific color by it’s number. Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-setrgbcolorno-redcolor-greencolor-bluecolor-n-a TODO: Make flags configurable via options
Creates a message that sets LED to a specified RGB value Sends message as defined in https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#output-sub-command-setrgbcolorno-colorno-n-a TODO: Make flags configurable via options
FIXME: This does not work yet
Receives and processes message with value from sensor.
(PortValueSingleMessage)
This handles the communication with the internal tilt sensor of Movehub.
There seem to be different modes implemented in the device. We just made
the one available that simply gets us the roll and pitch values.
Extends Peripheral
Receives nd processes message with value from sensor.
(PortValueSingleMessage)
This class represents a peripheral we don't know what we can do with it.
Extends Peripheral
This handles the communication and the values we receive from the external vision sensor of the Movehub. That one that measures the distance and the color it sees.
Extends Peripheral
Receives and processes message with value from sensor.
(PortValueSingleMessage)
Fires when a VisionSensor receives a new distance value.
(number)
Fires when a VisionSensor receives a new color value.
Fires when a VisionSensor receives a new color value.
This handles the communication with the internal voltage sensor of Movehub. The values it produces are in volts.
Extends Peripheral
Receives and processes message with value from sensor.
(PortValueSingleMessage)