A key-value pair Bluetooth service for BlockyTalky
Click on the gearwheel, then Extensions, search for blockytalky.
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.
blockytalky.sendNumber("temp", input.temperature())
The key
part of the message should be less or equal than 6 character long
blockytalky.sendString("marco", "polo")
The value
part of the message should be less than 11 character long
Register an event handler to handler number messages. A number can be integer or double.
blockytalky.onReceivedNumber(function (key, value) {
})
Register an event handler to handler string messages. A number can be integer or double.
blockytalky.onReceivedString(function (key, receivedString) {
})
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';
- Try this glitch in a WebBluetooth enabled browser: https://microbit-blockytalky.glitch.me
- Use chrome://bluetooth-internals to explore the GATT service
- Use NRFConnect on iOS/Android
MIT
- for PXT/microbit (The metadata above is needed for package search.)