A javascript library to interact with BBC micro:bit using web bluetooth API.
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.
microBit=new uBit()
microBit.connected
-
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)