webusb / arduino

WebUSB demos running on Arduino (and compatible) hardware.
566 stars 152 forks source link

Support for Arduino Micro #71

Closed MitchellJeppson closed 4 years ago

MitchellJeppson commented 4 years ago

Hi, I'm trying to follow this tutorial https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web, to read and write from Arduino board from a website. I am using an Arduino Micro. When I try to load the example program to my board I get the following errors:

Arduino: 1.8.10 (Mac OS X), Board: "Arduino Micro"

/<path>/WebUSB/WebUSB.cpp: In constructor 'WebUSB::WebUSB(uint8_t, const char*)':
/<path>/WebUSB/WebUSB.cpp:257:31: error: no matching function for call to 'PluggableUSBModule::PluggableUSBModule(int, int, uint8_t [2])'
    shortName(WEBUSB_SHORT_NAME)
                               ^
In file included from /<path>/WebUSB/WebUSB.h:27:0,
                 from /<path>/WebUSB/WebUSB.cpp:26:
/<path>/WebUSB/PluggableUSB.h:29:3: note: candidate: PluggableUSBModule::PluggableUSBModule(uint8_t, uint8_t, uint32_t*)
   PluggableUSBModule(uint8_t numEps, uint8_t numIfs, uint32_t *epType) :
   ^~~~~~~~~~~~~~~~~~
/<path>/WebUSB/PluggableUSB.h:29:3: note:   no known conversion for argument 3 from 'uint8_t [2] {aka unsigned char [2]}' to 'uint32_t* {aka long unsigned int*}'
/<path>/WebUSB/PluggableUSB.h:27:7: note: candidate: constexpr PluggableUSBModule::PluggableUSBModule(const PluggableUSBModule&)
 class PluggableUSBModule {
       ^~~~~~~~~~~~~~~~~~
/<path>/WebUSB/PluggableUSB.h:27:7: note:   candidate expects 1 argument, 3 provided
/<path>/WebUSB/PluggableUSB.h:27:7: note: candidate: constexpr PluggableUSBModule::PluggableUSBModule(PluggableUSBModule&&)
/<path>/WebUSB/PluggableUSB.h:27:7: note:   candidate expects 1 argument, 3 provided
Multiple libraries were found for "WebUSB.h"
 Used: /<path>/WebUSB
exit status 1
Error compiling for board Arduino Micro.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I have already upgraded to usb 2.1 and made sure the webUSB library shows in the ide. Any help would be appreciated. Thanks!