Package Exports
- movehub-async
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-async) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
movehub async
Simple to use asynchronous functions for the Lego Boost Move Hub
Install
$ npm install movehub-async
Usage
const boost = require('movehub-async');
const hub = await boost.getHubAsync();
await hub.ledAsync('red');
await hub.ledAsync('yellow');
await hub.ledAsync('green');
hub.motorTimeMulti(10, 20, 20);
API
Check non-async API definition from Lego Boost Move Hub
- boost.getHubAsync()
Create a connection to the Hub. Internally calls bleReadyAsync
, hubFoundAsync
and connectAsync
.
- boost.bleReadyAsync()
Wait for BLE device to be ready.
- boost.hubFoundAsync()
Wait for MoveHub found event.
- boost.connectAsync(connectDetails)
Initialize and wait for the connection to the Hub.
- hub.ledAsync(color)
Control the LED on the Move Hub.
Tester
Example project
Changelog
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Licensed under the MIT License.