adafruit / Adafruit_TinyUSB_Arduino

Arduino library for TinyUSB
MIT License
465 stars 120 forks source link

Compilation error: 'Adafruit_USBD_HID' does not name a type; did you mean 'Adafruit_USBD_CDC'? #273

Closed DaMatzii closed 1 year ago

DaMatzii commented 1 year ago

Operating System

Windows 11

Arduino IDE version

Arduino Ide 2.0.4

Board

Seeduino XIAO

ArduinoCore version

1.8.2

TinyUSB Library version

latest

Sketch as ATTACHED TXT

/***** Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

MIT license, check LICENSE for more information Copyright (c) 2019 Ha Thach for Adafruit Industries All text above, and the splash screen below must be included in any redistribution *****/

include "Adafruit_TinyUSB.h"

/* This sketch demonstrates USB HID mouse

// HID report descriptor using TinyUSB's template // Single Report (no ID) descriptor uint8_t const desc_hid_report[] = { TUD_HID_REPORT_DESC_MOUSE() };

// USB HID object Adafruit_USBD_HID usb_hid;

// the setup function runs once when you press reset or power the board void setup() { // Set up button, pullup opposite to active state pinMode(pin, activeState ? INPUT_PULLDOWN : INPUT_PULLUP);

usb_hid.setPollInterval(2); usb_hid.setReportDescriptor(desc_hid_report, sizeof(desc_hid_report));

usb_hid.begin();

Serial.begin(115200);

// wait until device mounted while( !USBDevice.mounted() ) delay(1);

Serial.println("Adafruit TinyUSB HID Mouse example"); }

void loop() { // poll gpio once each 10 ms delay(10);

// Whether button is pressed bool btn_pressed = (digitalRead(pin) == activeState);

// nothing to do if button is not pressed if (!btn_pressed) return;

// Remote wakeup if ( USBDevice.suspended() ) { // Wake up host if we are in suspend mode // and REMOTE_WAKEUP feature is enabled by host USBDevice.remoteWakeup(); }

if ( usb_hid.ready() ) { int8_t const delta = 5; usb_hid.mouseMove(0, delta, delta); // no ID: right + down } }

Compiled Log as ATTACHED TXT

where can i get this

What happened ?

when i try to compile it says that error

How to reproduce ?

just compile that with newest version

Debug Log

where can i find this?

Screenshots

no screen shots

hathach commented 1 year ago

I have no idea, you should ask Seeduino, they should able to provide support for their board