Hi,
I tried to make this project:
I had to buy a new board, and choose to buy the more recent Arduino Uno R4 Minima instead of the Arduino Leonardo, expecthing that both boards ability to act as mouse/keyboard was what was needed. But I'm now really struggling to make it work ;(
When trying to verify this code:
#include <WebUSB.h>
/**
* Creating an instance of WebUSBSerial will add an additional USB interface to
* the device that is marked as vendor-specific (rather than USB CDC-ACM) and
* is therefore accessible to the browser.
*
* The URL here provides a hint to the browser about what page the user should
* navigate to to interact with the device.
*/
WebUSB WebUSBSerial(1 /* https:// */, "webusb.github.io/arduino/demos/rgb");
#define Serial WebUSBSerial
const int redPin = 9;
const int greenPin = 10;
const int bluePin = 11;
int color[3];
int colorIndex;
void setup() {
while (!Serial) {
;
}
Serial.begin(9600);
Serial.write("Sketch begins.\r\n");
Serial.flush();
colorIndex = 0;
}
void loop() {
if (Serial && Serial.available()) {
color[colorIndex++] = Serial.read();
if (colorIndex == 3) {
analogWrite(redPin, color[0]);
analogWrite(greenPin, color[1]);
analogWrite(bluePin, color[2]);
Serial.print("Set LED to ");
Serial.print(color[0]);
Serial.print(", ");
Serial.print(color[1]);
Serial.print(", ");
Serial.print(color[2]);
Serial.print(".\r\n");
Serial.flush();
colorIndex = 0;
}
}
}
but I get this error:
In file included from C:\Users\[user]\Downloads\arduino-gh-pages\arduino-gh-pages\demos\rgb\sketch\sketch.ino:1:0:
C:\Users\[user]\AppData\Local\Arduino15\libraries\WebUSB/WebUSB.h:31:10: fatal error: PluggableUSB.h: No such file or directory
#include "PluggableUSB.h"
^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1