Skip to content

[GIGA] USB Keyboard Example fix #1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -432,34 +432,43 @@ After logging data, remove the USB stick from your board, and insert it in your

It is possible to connect generic USB keyboards to the GIGA R1's USB-A connector without any additional circuitry.

The library used for this can be downloaded through Github.
The library used for this can be downloaded through Github.
- [USBHostGiga](https://github.com/arduino-libraries/USBHostGiga)

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.

***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`.***

```arduino
#include "HIDHost.h"
#include "USBHostGiga.h"

Keyboard keyb; //create object
//REDIRECT_STDOUT_TO(Serial)
Keyboard keyb;
HostSerial ser;

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial);
pinMode(PA_15, OUTPUT); //enable the USB-A port //enable the USB-A connector
keyb.begin(); //init the library
pinMode(PA_15, OUTPUT);
keyb.begin();
ser.begin();
}


void loop() {
if (keyb.available()) {
Serial.println(keyb.read()); //print any incoming character
auto _key = keyb.read();
Serial.println(keyb.getAscii(_key));
}
while (ser.available()) {
auto _char = ser.read();
Serial.write(_char);
}
//delay(1);
}
```

***Please note that he `PA15` pin must be configured as an `OUTPUT`.***

## USB HID

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.
Expand Down
3 changes: 2 additions & 1 deletion scripts/resources/spell-check-ignore-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ synopsys
trun
complies
ro
som
som
ser