This is a 3 part post, in which i cover:
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.
- INTRODUCTION Arduino Uno Keyboard emulator - dfu mode / programming
- SKETCH Arduino Uno keyboard emulator - ino sketch
- COINS Coin acceptor (3 coins)
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.
- Start reading this hackaday post (http://hackaday.com/2012/06/29/turning-an-arduino-into-a-usb-keyboard/).
- Install a dfu-programmer (https://www.arduino.cc/en/Hacking/DFUProgramming8U2). I have installed a port for Mac and it works very well with super user privileges.
- Connect Arduino to USB port.
- Upload your keyboard sketch as usual.
- Copy from source in the same directory of the sketch the hex files.
- Enter in DFU Mode (is more simpler then expected): take a screwdriver and short for a moment the two pins in the next photo:
- 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