You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void setup() {
// Manual begin() is required on core without built-in support e.g. mbed rp2040
if (!TinyUSBDevice.isInitialized()) {
TinyUSBDevice.begin(0);
}
Serial.begin(9600);
// Set up HID
usb_hid.setBootProtocol(HID_ITF_PROTOCOL_MOUSE);
usb_hid.setPollInterval(2);
usb_hid.setReportDescriptor(desc_hid_report, sizeof(desc_hid_report));
usb_hid.setStringDescriptor("TinyUSB Mouse");
usb_hid.begin();
// If already enumerated, additional class driverr begin() e.g msc, hid, midi won't take effect until re-enumeration
if (TinyUSBDevice.mounted()) {
TinyUSBDevice.detach();
delay(10);
TinyUSBDevice.attach();
}
Operating System
Windows 11
Arduino IDE version
1.8
Board
esp32s3
ArduinoCore version
1
TinyUSB Library version
3.3
Sketch as ATTACHED TXT
Compiled Log as ATTACHED TXT
#include <Adafruit_TinyUSB.h>
// 单一报告(无 ID)描述符
uint8_t const desc_hid_report[] = {
TUD_HID_REPORT_DESC_MOUSE()
};
// USB HID 对象
Adafruit_USBD_HID usb_hid;
void setup() {
// Manual begin() is required on core without built-in support e.g. mbed rp2040
if (!TinyUSBDevice.isInitialized()) {
TinyUSBDevice.begin(0);
}
Serial.begin(9600);
// Set up HID
usb_hid.setBootProtocol(HID_ITF_PROTOCOL_MOUSE);
usb_hid.setPollInterval(2);
usb_hid.setReportDescriptor(desc_hid_report, sizeof(desc_hid_report));
usb_hid.setStringDescriptor("TinyUSB Mouse");
usb_hid.begin();
// If already enumerated, additional class driverr begin() e.g msc, hid, midi won't take effect until re-enumeration
if (TinyUSBDevice.mounted()) {
TinyUSBDevice.detach();
delay(10);
TinyUSBDevice.attach();
}
}
void process_hid() {
// 如果 HID 准备好了
if (usb_hid.ready()) {
uint8_t const report_id = 0; // 无 ID
int8_t const delta = 5; // 移动步幅
usb_hid.mouseMove(report_id, delta, delta); // 模拟向右和向下移动
}
}
void loop() {
#ifdef TINYUSB_NEED_POLLING_TASK
TinyUSBDevice.task();
#endif
}
What happened ?
How to reproduce ?
Unable to mount
Debug Log
No response
Screenshots
The text was updated successfully, but these errors were encountered: