Arduino string / password keyboard emulator using reset button

Arduino has a nice Keyboard library that allows it to pretend to be a keyboard to any host it is connected to. This allows you to automatically “type” passwords or strings, eliminating a potential source of error (though this still obviously exists while programming the arduino). Unlike other examples, this does not require you to have an external button or the like. The reset button will simply act as the activator.

To start the “typing” of the string, either plug the arduino into the USB port or if already connected to the USB port, simply press the arduino’s reset button and it will print the programming string. On the Arduino Due, you will have to connect the USB cable to the “native USB” port, rather than the programming port.

Here’s the code arduino code:

void setup() {
  // do not remove this delay or you will brick the arduino
  delay(1000);
  Keyboard.begin();
  Keyboard.println("replace with string to be printed");
  Keyboard.end();
}

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

Now read this

Initial Apple Watch Experience

Early in the day, I’m mildly giddy with anticipation. I’ve ordered the space grey sports watch. It finally arrives around midday, when I’m in the middle of a call with my bank who have screwed up. This obviously makes the phone... Continue →