JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q32241F
  • License MIT

Asynchronous functions for the Lego Boost Move Hub package

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

npm version

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

tester.js

Example project

lego-boost-ai

Changelog

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.