microbit-webusb-p5js

A javascript library to interact with BBC micro:bit and p5.js over WebUSB

View the Project on GitHub nkymut/microbit-webusb-p5js

microbit-webusb-p5js

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

Based on the library created by bsiever/microbit-webusb and updated to provide the same API for UART properties as nkymut/microbit-webble-p5js and enabled easy transition from WebUSB to WebBluetooth development interoperability.

Setup

  1. Upgrade Micro:bit to latest firmware (above version 249) ** Updating your micro:bit firmware

  2. Program the Micro:bit with one of the example programs that generates serial data
  3. Setup a Web Server & Open the project’s page to run the sample application. VSCode + Live Server Extention

Constructor

Properties

Functions

Examples

Check the examples folder for working examples.

UART Echo example

Learn how to exchange text messages between the microbit and a p5.js sketch via UART, update microBit’s LED message from the sketch.

micro:bit code

Try it here

UART LightSensor example

Learn how to receive lightsensor value from the microbit and update a p5.js sketch via UART.

micro:bit code

Try it here

Neopixel Control example

Learn how to control the color of Neopixel LED connected to micro:bit from p5.js sketch via UART.

micro:bit code

Try it here

References