N64 To USB, or how to turn your Arduino in a USB HID joystick w/ N64 controllers

is there a sample code that just simulates button presses and joystick movements? I wrote a sample program to toggle some of the buttons but it keeps moving one of the joystick axis.

I don't know what i am doing wrong.

The test program can simulate button presses sequentially with a delay (100) in between them. this way I can look in the joystick calibration dialog in windows.

thanks.