BLE - HID 滑鼠

材料準備

  • AmebaD [AMB21 / AMB22 / AMB23 / BW16] x 1

  • 支援 BLE 的設備 [Windows / Linux / MacOS / Android

範例説明

介紹

在此範例中,RTL8722 開發板用來模擬使用 BLE 連接的 HID 滑鼠。

步驟

Open the example, “Files” “Examples” “AmebaBLE” “BLEHIDMouse”.

1

Upload the code and press the reset button once the upload is finished. Immediately after reset, the board will begin BLE advertising as “AMEBA_BLE_HID”. On your host device, go to the Bluetooth settings menu, scan, and connect to the board. You should ensure that the connection process is completed before proceeding. On Windows, ensure that any driver installation is finished, and the board shows up in the Bluetooth menu under the “Mouse, keyboard & pen” category.

2

在 Android 上,確保為開發板啟用“Input device”。

3

After the Bluetooth connection process is completed, the board is ready to send mouse input to the host device. Connect digital pin 8 to 3.3V to start sending input, and connect to GND to stop. You should see the mouse cursor move around four points in a square, performing right and left clicks, and scrolling up and down.

程式碼説明

如何定義鼠標輸入取決於主機設備。 某些系統(例如Android)可能不支持所有鼠標按鈕輸入功能。