Loading content…
Connect a BBC micro:bit v2 from your computer, then send serial/UART commands from the browser. Click the board or use the command panel once connected.
Flash micro:bit v2 with a UART listener. Each command is one line ending with a newline (\n).
MakeCode example:
bluetooth.startUartService()
function handleCommand(cmd: string) {
if (cmd == "SMILE") { basic.showIcon(IconNames.Happy) }
else if (cmd == "SAD") { basic.showIcon(IconNames.Sad) }
else if (cmd == "CLEAR") { basic.clearScreen() }
else if (cmd == "HEART") { basic.showIcon(IconNames.Heart) }
else if (cmd == "YES" || cmd == "LOGO") { basic.showIcon(IconNames.Yes) }
else if (cmd == "NO") { basic.showIcon(IconNames.No) }
// Короткий тон в фоне: длинная мелодия / UntilDone рвёт BLE-стек на v2
else if (cmd == "BEEP") {
music.play(music.tonePlayable(Note.C, 100), music.PlaybackMode.InBackground)
}
else if (cmd.substr(0, 5) == "TEXT:") { basic.showString(cmd.substr(5)) }
}
// USB (Web Serial) — то, что уже работает у вас
serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
handleCommand(serial.readUntil(serial.delimiters(Delimiters.NewLine)))
})
// Web Bluetooth UART — без этого блока BLE-команды не доходят
bluetooth.onUartDataReceived(serial.delimiters(Delimiters.NewLine), function () {
handleCommand(bluetooth.uartReadUntil(serial.delimiters(Delimiters.NewLine)))
})Connect a micro:bit to enable the interactive board
Web Bluetooth is not available in this browser.
USB connection requires Chrome or Edge with Web Serial or WebUSB.
Listens for Alice → UART commands over Pusher and sends them to the connected micro:bit via USB or Bluetooth.
Use the buttons below or click the micro:bit SVG (buttons, display, logo, speaker).
ICON commands