Approved content

The content below is provided by a partner.

laboratoryforplayfulcomputation/pxt-blockytalkyble 0.0.21 GitHub

blockytalkyble-dal

A key-value pair Bluetooth service for BlockyTalky

Using this extension

Click on the gearwheel, then Extensions, search for blockytalky.

Using the extension

This extension uses Bluetooth Low Energy to communicate to other divices. You will need to pair the micro:bit to a device that supports the BlockyTalky bluetooth profile.

Sending Number

blockytalky.sendNumber("temp", input.temperature())

The key part of the message should be less or equal than 6 character long

Sending String

blockytalky.sendString("marco", "polo")

The value part of the message should be less than 11 character long

Receiving number

Register an event handler to handler number messages. A number can be integer or double.

blockytalky.onReceivedNumber(function (key, value) {

})

Receiving string

Register an event handler to handler string messages. A number can be integer or double.

blockytalky.onReceivedString(function (key, receivedString) {

})

Bluetooth Profile

const BLOCKY_TALKY_SERVICE = '0b78ac2d-fe36-43ac-32d0-a29d8fbe05d6';
const TX_CHARACTERISTIC = '0b78ac2d-fe36-43ac-32d0-a29d8fbe05d7';
const RX_CHARACTERISTIC = '0b78ac2d-fe36-43ac-32d0-a29d8fbe05d8';

Testing

License

MIT

Supported targets

BlockyTalky-BLE=github:laboratoryforplayfulcomputation/pxt-blockytalkyble#v0.0.21