Home

Awesome

bluedot

~ hint

WORK IN PROGRESS

~

A sample of Bluetooth Low Energy port of the BlueDot protocol for the micro:bit.

Bluetooth Low Energy Service

The BlueDot service contains 2 characteristic for the button pressure and the position.

Button Characteristic

An unsigned byte that represents the button pressure. 0 means not pressed, positive values means pressed.

Position Characteristic

An unsigned int which contains the X and Y positions.

Each values is mapped onto an unsigned short where 0 is the left or bottom position.

Usage

bluedot.startService();
bluedot.onButton(BlueDotButtonState.Down, () => {
    led.unplot(0, 2);
})
bluedot.onButton(BlueDotButtonState.Up, () => {
    led.plot(0, 2);
})

License

MIT

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Supported targets

bluedot=github:microsoft/pxt-bluedot