Skip to content

A javascript library to interact with BBC micro:bit using web bluetooth API

License

Notifications You must be signed in to change notification settings

neosac/microBit.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microBit.js

A javascript library to interact with BBC micro:bit using web bluetooth API.

Usage

To use the library, download and upload this firmware on your BBC micro:bit board.

The firmware was produced by bittysoftware.

Keep in mind that web bluetooth API are still experimental and your OS and browser might not support the feature. Read more about this here.

This Library allows you to read and write the values of all the BLEcharacteristic exposed by the microBit board using simplified API's.

For more info about all micro:bit ble services please refer to the official documentation.

The example folder provided contains several examples for interacting with the device.

Constructor

  • microBit=new uBit()

Properties

  • microBit.connected

Functions

  • microBit.searchDevice()

  • microBit.setButtonACallback(callbackFunction)

  • microBit.setButtonBCallback(callbackFunction)

  • microBit.onConnect(callbackFunction)

  • microBit.onDisconnect(callbackFunction)

  • microBit.onBleNotify(callbackFunction)

  • microBit.writeMatrixIcon(icon)

  • microBit.writeMatrixText(text)

  • microBit.getAccelerometer()

  • microBit.getTemperature()

  • microBit.getBearing()

  • writeMatrixTextSpeed(speed)

About

A javascript library to interact with BBC micro:bit using web bluetooth API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%