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
Please note that this library is in **Alpha** development stage. This means support is experimental and examples may not function as expected. Future versions of this library may break the example provided below.
439
+
438
440
***The USBHostGiga library is not available in the Arduino IDE and needs to be installed manually. You can do so my navigating to `Sketch` > `Include Library` > `Add .ZIP Library`.***
439
441
440
442
```arduino
441
-
#include "HIDHost.h"
443
+
#include "USBHostGiga.h"
442
444
443
-
Keyboard keyb; //create object
445
+
//REDIRECT_STDOUT_TO(Serial)
446
+
Keyboard keyb;
447
+
HostSerial ser;
444
448
445
449
void setup() {
446
450
// put your setup code here, to run once:
447
451
Serial.begin(115200);
448
452
while (!Serial);
449
-
pinMode(PA_15, OUTPUT); //enable the USB-A port //enable the USB-A connector
450
-
keyb.begin(); //init the library
453
+
pinMode(PA_15, OUTPUT);
454
+
keyb.begin();
455
+
ser.begin();
451
456
}
452
457
453
458
454
459
void loop() {
455
460
if (keyb.available()) {
456
-
Serial.println(keyb.read()); //print any incoming character
461
+
auto _key = keyb.read();
462
+
Serial.println(keyb.getAscii(_key));
463
+
}
464
+
while (ser.available()) {
465
+
auto _char = ser.read();
466
+
Serial.write(_char);
457
467
}
468
+
//delay(1);
458
469
}
459
470
```
460
471
461
-
***Please note that he `PA15` pin must be configured as an `OUTPUT`.***
462
-
463
472
## USB HID
464
473
465
474
It is possible to turn your GIGA R1 board into a Human Interface Device **(HID)**, aka mouse & keyboard, using the [USBHID](https://github.com/arduino/ArduinoCore-mbed/tree/master/libraries/USBHID) library which is included in the GIGA core.
0 commit comments