Package Exports
- movehub
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (movehub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
movehub
Node.js interface for the Lego Boost Move Hub
WORK IN PROGRESS - UNFINISHED!
Install
$ npm install movehub
TODO
- LED control
- Motor control
- Sound playback
- Emit distance sensor events
- Emit color sensor events
- Emit rotation events
- Emit tilt sensor events
- Connect to multiple Move Hubs
- API Docs
API
Boost
Kind: global class
boost.disconnect()
Disconnect from Move Hub
Kind: instance method of Boost
boost.motorTime(port, milliseconds, [dutycyle], callback)
Run a motor for specific time
Kind: instance method of Boost
Param | Type | Default | Description |
---|---|---|---|
port | string | number |
possible string values: A , B , AB , C , D |
|
milliseconds | number |
||
[dutycyle] | number |
100 |
motor power percentage from -100 to 100 . If a negative value is given rotation is counterclockwise. |
callback | function |
boost.motorAngle(port, angle, [dutycyle], callback)
Turn a motor to specific angle
Kind: instance method of Boost
Param | Type | Default | Description |
---|---|---|---|
port | string | number |
possible string values: A , B , AB , C , D |
|
angle | number |
0-360° | |
[dutycyle] | number |
100 |
motor power percentage from -100 to 100 . If a negative value is given rotation is counterclockwise. |
callback | function |
boost.led(color, [callback])
Control the LED on the Move Hub
Kind: instance method of Boost
Param | Type | Description |
---|---|---|
color | boolean | number | string |
If set to boolean false the LED is switched off, if set to true the LED will be white. Possible string values: off , pink , purple , blue , lightblue , cyan , green , yellow , orange , red , white |
[callback] | function |
"scanning"
reports true
/false
when noble starts/stops to scan for BLE devices
Kind: event emitted by Boost
"hub-found"
Fires when a Move Hub is found
Kind: event emitted by Boost
Properties
Name | Type |
---|---|
uuid | string |
address | string |
localName | string |
rssi | number |
"connect"
Fires when a connection to the Move Hub is established
Kind: event emitted by Boost
"disconnect"
Kind: event emitted by Boost
Contributing
Pull Requests welcome! :-)
Credits
Thanks to Jorge Pereira who analyzed and documented the move hub ble protocol: https://github.com/JorgePe/BOOSTreveng
License
MIT (c) Sebastian Raff