micro:bit ↔ Minecraft Education Edition bridge extension.
Send messages, sensor readings and variables between your micro:bit and Minecraft via the meews bridge server.
This repository can be added as an extension in MakeCode.
- open https://makecode.microbit.org/
- click on New Project
- click on Extensions under the gearwheel menu
- search for https://github.com/gamenoodlesoup/pxt-microbit-bridge and import
Send a free-form text message to Minecraft. Arrives as mb:msg script event.
MinecraftBridge.sendMessage("hello")
Send a named sensor reading to Minecraft. Arrives as mb:sensor script event.
MinecraftBridge.sendSensor("temperature", input.temperature())
Send a named variable to Minecraft. Arrives as mb:var script event.
MinecraftBridge.sendVariable("score", 42)
input.onButtonPressed(Button.A, function () {
MinecraftBridge.sendMessage("button_a")
})
input.onButtonPressed(Button.B, function () {
MinecraftBridge.sendSensor("temperature", input.temperature())
})
- micro:bit boots → sends
READYover serial at 115200 baud - Browser bridge sends
CODE:XXXX→ micro:bit displays the 4-char pairing code on LEDs - Student uses blocks to send data → serial → browser → meews server → Minecraft
- Minecraft can send commands back →
CMD:display:Hello→ micro:bit scrolls "Hello"
| Command | micro:bit action |
|---|---|
CMD:display:<text> |
Scroll text on LED |
CMD:icon:<name> |
Show built-in icon |
CMD:beep |
Play a tone |
CMD:clear |
Clear LED matrix |
Serial at 115200 baud, newline-delimited.
micro:bit → browser:
| Message | Format |
|---|---|
| Ready signal | READY |
| Text message | MSG:<text> |
| Sensor reading | SENSOR:<name>:<value> |
| Variable | VAR:<name>:<value> |
browser → micro:bit:
| Message | Format |
|---|---|
| Pairing code | CODE:<4-char> |
| Display text | CMD:display:<text> |
| Show icon | CMD:icon:<name> |
| Play beep | CMD:beep |
| Clear screen | CMD:clear |
MIT
- for PXT/microbit