utton>
        <div id="status">Status: Disconnected</div>
        <pre id="log" style="white-space: pre-wrap"></pre>

        <script>
            const statusDiv = document.getElementById("status");
            const logDiv = document.getElementById("log");
            let controlCharacteristic = null;

            const BUTTON_MASKS = {
                LEFT_BTN: 0x1,
                UP_BTN: 0x2,
                RIGHT_BTN: 0x4,
                DOWN_BTN: 0x8,
                A_BTN: 0x10,
                B_