From 2a8759c4ce8f18bb60dd66451011d045043ec3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Mon, 24 Apr 2023 12:27:01 +0200 Subject: [PATCH 1/2] [GIGA] USB Keyboard Example fix Updated example that was broken. --- .../tutorials/giga-usb/giga-usb.md | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md index e3a31c8cd9..e533b031e9 100644 --- a/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md +++ b/content/hardware/10.mega/boards/giga-r1-wifi/tutorials/giga-usb/giga-usb.md @@ -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. From 16a408263fdca237422672c578f81535f98819fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20S=C3=B6derby?= <35461661+karlsoderby@users.noreply.github.com> Date: Mon, 24 Apr 2023 15:10:06 +0200 Subject: [PATCH 2/2] spellcheck fix --- scripts/resources/spell-check-ignore-list.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/resources/spell-check-ignore-list.txt b/scripts/resources/spell-check-ignore-list.txt index 63807a206d..5953158559 100644 --- a/scripts/resources/spell-check-ignore-list.txt +++ b/scripts/resources/spell-check-ignore-list.txt @@ -11,4 +11,5 @@ synopsys trun complies ro -som \ No newline at end of file +som +ser \ No newline at end of file