Arduino Due Keyboard Emulator

Hi guys so recently after the death of my arduino Micro (rest in pieces) I decided to upgrade to an arduino Due. (https://www.amazon.fr/Kookye-Carte-dextension-compatible-Arduino/dp/B019SXN9WA/ref=sr_1_1?ie=UTF8&qid=1505648235&sr=8-1&keywords=kookye+due). Being used to the Keyboard Library thx to my arduino Micro, I decided to test it out on the Due as in theory it should work.

#include <Keyboard.h>

void setup() {
// put your setup code here, to run once:
Keyboard.begin();
Keyboard.print(“Hello world!”);

}

void loop() {
// put your main code here, to run repeatedly:

}

I uploaded it to my Arduino due and suprise surprise, it didn’t work. I looked at the forum online and it said to use the Native USB port. Tried it and failed. I’m in desperate need of help.

In theory, theory and practice are the same but in practice they are not. the DUE is based on a 32_bit ARM chip (Sam3x8e) very different from an AVR.

You could try the USBHost Library for DUE. The USBHost library allows an Arduino Due board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards.

The following works fine for more on a Zero which has a native port and programming port. Set the IDE to use the programming port but connect both ports to the PC. I do not have a Due handy but this feature should work the same on both.

void setup() {
  Keyboard.begin();
}

void loop() {
  Keyboard.print("Hello world");
  delay(1000);
}