So I have got an Arduino Giga r1 WiFi.
I wanted to try out the HID emulation feature via USB-C Port, but I can't really get that thing to work, even with the example code.
When using the example code, it doesn't give an error while uploading, but then it does nothing when done uploading.
Anyone got ideas?
(btw sorry for bad english I'm from Germany)
Hi @fincat , as far as I know, the USBHID is for the USB-A Port not USB-C.
Hi @fincat.
There are many examples, so this statement is ambiguous. In order for the forum helpers to have a more complete understanding of the situation, I'm going to ask to to post the full sketch.
I'll provide instructions you can follow to do that:
- Click on the window that contains your sketch code.
- Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
This will select all the text. - Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
This will copy the selected text to the clipboard. - Open a forum reply here by clicking the "Reply" button.
- Click the
<CODE/>icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
- Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the copied code into the code block. - Move the cursor outside of the code block markup before you add any additional text to your reply.
- Repeat the above process if your sketch has multiple tabs.
- Click the "Reply" button to post the output.
When your code requires a library that's not included with the Arduino IDE please post a link to where you downloaded that library from, or if you installed it using Library Manager (Sketch > Include Library > Manage Libraries... in Arduino IDE or Libraries > Library Manager in Arduino Cloud Editor) then say so and state the full name of the library.
#include "PluggableUSBHID.h"
#include "USBKeyboard.h"
USBKeyboard Keyboard;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000);
Keyboard.printf("Hello world\n\r");
}
So that's the code. In my libraries folder, there is pluggableusbhid.h but no corresponding .cpp file.
also, in the internet there's only information that it is for USB-C.
Thanks for helping,
fincaz
ah, yes, my mistake. You want the GIGA to emulate a keyboard not be host to a kb you are plugging into the GIGA (should have paid more attention)
Your code works just fine for me. When I upload the sketch to my board, it repeatedly types "Hello world", just as expected.
Which operating system are you using on your computer (e.g., "Windows")?
Hi there again,
thanks for trying to help.
I am using Windows 11.
