Keyboard Error in Programming a Rubber Ducky

Hey guys, I am doing my first project with Arduino. Concretely, my goal is to code a rubber ducky. But I am having certain errors like error: expected ‘;’ before ‘Keyboard’
Keyboard.releaseAll(); and error: ‘Keyboard’ no encontrado. Tu sketch incluye la línea ‘#include <Keyboard.h>’?
Keyboard.press(‘r’);

I am actually following a youtube tutorial, this is it: Como hacer una USB Rubber Ducky con Arduino - YouTube

And this is my code. I am sorry if I make such a coding sin because of my ignorancy

#include <Keyboard.h>

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);
  Keyboard.begin();
  delay(500)
  
  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press('d');
  delay(500)
  Keyboard.releaseAll();
  delay(500)
  
  Ejecutar();
  Tipear("notepad");
  Enter();
  

  delay(500)
  Keyboard.end();
  digitalWrite(LED_BUILTIN, LOW);
}

void loop() {
}

void Tipear(char txt[]) {
  delay(500);
  Keyboard.print(txt);
  delay(500)
}

void Enter() {
  delay(500)
  Keyboard.press(KEY_RETURN);
  delay(500)
  Keyboard.release(KEY_RETURN);
}

void Ejecutar() {
  delay(500)
  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press('r');
  delay(500)
  Keyboard.releaseAll();
}

Forget to mention that my plaque is an ELEGOO MEGA2560. 'Cause it seemed to function just as a LEONARDO

Rubber Ducky ?

I'm out

3leduk:
Forget to mention that my plaque is an ELEGOO MEGA2560. 'Cause it seemed to function just as a LEONARDO

except that the product information disagrees.

What purpose does an Arduino play in a rubber duck ?

Is its a remote controlled duck of some type, if so tell us what motors, servos and batteries you are planning to use.

delay(500)

oops

delay(500);

You make the same mistake more than once.
Also, this will not work on your board anyway.

I looked it up. A rubber ducky, as well as being a toy and a song is a thing that pretends to be a memory stick but instead contains a HID along with a microcontroller. So you plug it into a PC and it pretends to be a keyboard, and then does whatever nasty things to the PC that it's been programmed to do.

I'm certainly not going to offer any help with such a thing.

Thanks to all for asking. For anyone who doesn't know what a rubber ducky is, it is actually a USB that pretends to be a keyboard and do things to the computer with pre-programmed codes.
Although I have to say that my intention is not to make some nasty things to other computers, it is all about personal learning and getting confident in this world.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.