Let me start
When I was looking for a cheap teensy alternative it was late....I was feeling sleepy. I found something cheap and thought, let me order this.
Did not look at the fact it was an ATMega328p chip (Arduino Nano clone), not an ATMega32U4 (or something else with native USB HID support)
I ordered it at a chinees site, so during the wait (a couple of weeks), I decided to order some teensy alternatives as well.
Finally the Nano clones arrived and I decided to give it a go (still waiting on the teensy clones BTW)
Let me start by saying:
1. USBHIDDescriptors are terrible
2. A lot of examples on the web do not work or...
3. If you try to change something, everything brakes down

I got it to work.
You start with soldering an USB connection to pins D2, D4 and D5 using two zener diodes 3v6, two 68r resistors, one 2.2k resistor (I actually used an 1.5k resistor).
Use the following schema (taken from http://blog.petrockblock.com/2012/05/19 ... an-example):
I also found a library on this page that is based on the AVR VUSB library, but that was sending the keystrokes like a,up,a,up,a,up,a,up,a,up,a,up when both were pressed, when actually you want both the be sent simultanious.
So I changed it a bit.
Keep in mind you need to use the arduino software version 1.0.5 (not newer, I still need to look into that ).
I put the instructions and software on github:
https://github.com/beidehand/UsbKeyboard
in short:
1. use version 1.0.5 of the arduino IDE which you can find at: https://www.arduino.cc/en/Main/OldSoftw ... ases#1.0.x
2. after you install the IDE go to the libraries folder and add the files from this repository (located under libraries)
3. pins 2,4 and 5 are used for USB communications (D2, D4, D5 on a Arduino Nano V3) see schematic.jpg
4. solder the diodes and resitors to D2, D4 and D5 as shown in the schematic
5. pins 14,15,16,17 are actually analog pins(A0,A1,A2,A3), but the can be used as digital inputs as well
6. this software is pull-up, so your buttons should go to ground (not 5V or else). Use a common ground.
The pin setup for the keys is as follows:
define NUMBER_OF_KEYS 15
char pinCharacters[NUMBER_OF_KEYS] = { KEY_ENTER,KEY_RIGHT_SHIFT,KEY_Z,KEY_X,KEY_A,KEY_S,KEY_ARROW_UP,KEY_ARROW_DOWN,KEY_ARROW_LEFT,KEY_ARROW_RIGHT,KEY_K,KEY_Q,KEY_W,KEY_E,KEY_R};
int pinButton[NUMBER_OF_KEYS] = { 0,1,3,6,7,8,9,10,11,12,13,14,15,16,17};
meaning:
pin0 : KEY_ENTER
pin1 : KEY_RIGHT_SHIFT
pin3 : KEY_Z
pin6 : KEY_X
pin7 : KEY_A
pin8 : KEY_S
pin9 : KEY_ARROW_UP
pin10 : KEY_ARROW_DOWN
pin11 : KEY_ARROW_LEFT
pin12 : KEY_ARROW_RIGHT
pin13 : KEY_K
pin14 : KEY_Q
pin15 : KEY_W
pin16 : KEY_E
pin17 : KEY_R
Now load the ino file containing the arduino software for the board
Select the correct board and port to use in the menu's of the arduino software
I did not find any additional information on this in these forums.....that why I'm sharing.
If there are better options please let me know
