Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 2.1 KB

README.md

File metadata and controls

27 lines (19 loc) · 2.1 KB

BlockyTalkyBLE

MakeCode Microbit package used to communicate over the Bluetooth Low Energy UART with a simple read and write of key value pairs. Requires Microbit Bluetooth package. Cannot be used with Radio package.

To use:

BlockyTalkyBLE has 4 blocks/functions:

  • on string received - An event handler that fires when a correctly formed message containing a string value is received over Bluetooth. Add blocks for your eventhandler inside this block. Set the key to the expected string. Use the string received in the message as a variable within the block.
  • on number received - An event handler that fires when a correctly formed message containing a number value is received over Bluetooth. Add blocks for your eventhandler inside this block. Set the key to the expected string. Use the number received in the message as a variable within the block.
  • send string key value - Send message over Bluetooth. Key and value are both strings.
  • send string key value - Send message over Bluetooth. Key is a string and value is a number.

Clients devices must be paired with the microbit (depending on the pairing method chosen in the editor's Project Settings).

A couple tips:

  • It is helpful while building a project for the microbit to show whether the microbit is connected or not. Use the Bluetooth.onBluetoothConnected() and Bluetooth.onBluetoothDisonnected() event handler to display a 'c' or 'd' respectively when connection changes.
  • If messages are not being received as expected, ensure the keys match (including case) on microbit program and client app.

Supported targets

  • for PXT/microbit

Examples

Please see our getting started guide and videos here: http://www.playfulcomputation.group/blockytalkyble.html