Wednesday, October 5, 2016

COIN-OP: mini arcade cabinet build log 1/3

This is a 3 part post, in which i cover:
  1. INTRODUCTION Arduino Uno Keyboard emulator - dfu mode / programming
  2. SKETCH Arduino Uno keyboard emulator - ino sketch
  3. COINS Coin acceptor (3 coins)
Source code is available on Google Drive folder:
SOURCE CODE

INTRODUCTION


Finally i had the opportunity to complete the Arduino Uno Keyboard emulator, including the Coin Acceptor (3 coins) from Sparkfun (SPARKFUN COM-11719).

After some tweaking the emulator works like a charm.
I had some trouble with key press & release, because we need to leave to OS the key repeat function.
The current version works very well with Mame on Windows 98.

The Keyboard HID hex is based on LUFA and is needed to make Arduino Uno act as a Keyboard, Joystick, Mouse, etc: for more information, check this link Arduino UNO Keyboard HID version 0.3 from darran

There is a copy attached also to this post. Please use at your own risk, this is working for me, but i cannot guarantee for your hardware.


A note: while using keyboard LUFA hex, pins 0 and 1 (TX and RX) will not work as digital pin, so don't use them.




  • From terminal, change directory to the sketch dir, and execute:
    • sudo dfu-programmer atmega16u2 erase
    • sudo dfu-programmer atmega16u2 flash --debug 1 Arduino-keyboard-0.3.hex
    • sudo dfu-programmer atmega16u2 reset
  • Disconnect and reconnect usb
If you want to revert Arduino to usb bootloader to update the sketch (this is the tricky part), simply repeat these steps:
  • Disconnect and reconnect usb
  • From terminal, change directory to sketch dir, and execute:
    • sudo dfu-programmer atmega16u2 erase
    • sudo dfu-programmer atmega16u2 flash --debug 1 Arduino-usbserial-atmega16u2-Uno-Rev3.hex
    • sudo dfu-programmer atmega16u2 reset
  • Disconnect and reconnect usb
The dfu mode is always available, i never had trouble with this.

In the next post, i'll cover the keyboard sketch to make the Arduino working.

No comments:

Post a Comment