⚠ This browser doesn't support Web Bluetooth, so it can't connect to a micro:bit here. Use desktop Chrome or Edge, or Chrome on Android. Safari, Firefox and iOS browsers don't work.
This is a proof of functionality of connecting a micro:bit to a webpage via Bluetooth to send messages back and forth between microbit and browser. You could extend this technique to make a physical joystick for a web based game, for example.
Set makecode project settings to "No Pairing Required: Anyone can connect via Bluetooth."
Restart Microbit
On this page, click the "Pair micro:bit via Bluetooth" button above
In the pop up window, select BBC microbit [NAME] and click "pair"
Notes
Requires Chrome or Edge — Web Bluetooth is not supported in Firefox or Safari.
To unpair, quit and restart Chrome — this doesn't always clear it though. If reconnecting still fails
after that, revoke the permission directly (site info icon in the address bar → Site Settings →
Bluetooth devices) and reflash the micro:bit to forget its side of the pairing.
More technical notes are written in the code comments of this webpage
Each micro:bit has a random five-character name like ZUPIG that you might see when you are connecting via Bluetooth. How to find your microbit's name