The Atmega 32U4 chip has the capability of emulating a mouse and keyboard through the USB port.

With boards like the Olympia CircuitsArno or LeOlympia, Arduino Leonardo or Sparkfun Micro, you can use this capability to have some fun.  We've used it to draw words and images in a paint program and enter repetitive text in forms.  This project is a little more fun.

I wrote a simple sketch that takes advantage of this to annoy your friends (or enemies).  There are several options in the sketch that can be selected and combined to get the effect you want. 

Basically, you set a time factor and the type of action to have the cursor do when the time comes around.  I made a Jitter routine that "shakes" the cursor and a Jump routine the moves the cursor across the screen.   You can add a beep to those to add to the mystery. 

Plug your board into a USB port on the back of a PC or a USB hub that's out of the way and wait for the confused looks.  "Maybe it's a dirty mouse ball", "Are my eyes deceiving me?"...

With most computers you can plug the Arno in and the mouse and keyboard drivers will start working.  There may be a few driver install pop-ups in Windows, but it will eventually start working. 

This trick will work with other boards that have USB built in, such as our LeOlympia, the Arduino Leonardo, Sparkfun Micro and so on..

Step 1: Set up your board

For this to work you need to get set up with either the Arduino IDE or Codebender.  Then you need to set up the drivers on your computer.  Go to this page for information.  There are also some links to troubleshooting pages on the Oly Circuits forum.

Now you're ready to start programming your board.
<p>Sorry to bring up an old post..</p><p>but I am trying the same thing (more or less).. in the end it will be using a USB Host shield as well.. to connect the original keyboard as a passive (and hide the Pro-Micro inside the keyboard enclosure)..<br><br>What I am not clear about is all this driver install prompts?? I get it on my dev machine when I'm uploading code..etc.. that needs the Pro-Micro driver installed.. but on the end/target machine.. there will be no drivers, so the prompt will 'give it away' (so to speak).. does this always happen? Is there a way to make the Pro-Micro 'look' like a HID keyboard when connected? Instead of all the Pro-Micro and multiple device driver prompts?<br><br>Thanks</p>
SparkFun Micro? No, it's actually the Pro Micro. The Micro is an official Arduino board.
Haha this is genius

About This Instructable




More by KBill:Jack-O-Lantern Lights with Arduino Mouse Prank with Arduino 
Add instructable to: