I'm new to arduino and had an idea for a project where I can use an old typewriter as a keyboard. I was planning on using a switch attached to the bottom of each lever then connecting these back to the uno.
I bought an Elegoo uno R3 and I was hoping to use that. However after some research I found that the Keyboard library only works for 32u4 based boards or Due and Zero and I can't find any libraries that work for the uno.
Another drawback was that I didn't have enough I/O pins on the Uno for a full alphabet and numbers.
I was planning on buying a Due, but before I spend any money on it does anyone know if it's possible to do it with an uno? Also does anyone know of any better ways to trigger the electrics for each lever (I was thinking a motion sensor for each lever but this would soon add up in price).
Any help is much appreciated. Please also bear in mind my arduino knowledge is limited.
There is kludge firmware available for the 16u2 chip used on the Arduino UNO and Arduino Mega 2560 that allows those device to send USB keyboard messages. You should order a USBasp and 6-pin adapter so you can burn the firmware easily. You can get them for less than $5 through eBay but the ship time from Asia will be a few weeks. For more money you can get one from a more local source.
How many switches do you have? 26 alphabetical, 10 numeric... assorted others. You could wire them as a matrix and get 49 keys with 14 pins. Remember that you can use A0 through A5 as digital pins.
Hi John, thanks for the reply, I've been doing some research and I'm slightly unsure as to what to do once I've hooked up the USBasp to the uno. Am I right in thinking that I download the driver from USBasp - USB programmer for Atmel AVR controllers - fischl.de and that I need to download AVRDUDE? After that I'm unsure as to what to do I've watched some videos on youtube but none were particularly useful.
There are a total of 46 keys on the typewriter, I didn't realize you could wire them as a matrix this seems a better option than my idea.
No need to download fresh USBasp firmware since the USBasp already has firmware installed.
No need to download AVRDUDE since it is part of the Arduino IDE installation.
There are two 6-bin ICSP headers on the UNO and MEGA. One for the Arduino processor (ATmega328P, ATmega2560) and one for the 16U2 processor used as a USB-to-Serial converter.
A Google search should turn up the kludge firmware for the 16U2. Instructions for uploading:
Notes:
Change "-cusbasp" to match your ISP device.
Change "-pm16u2" if your board has the older m8u2.
Change Directory to the Arduino "hardware" directory.
On Windows it is something like:
cd "C:\Program Files (x86)\arduino-1.6.13\hardware"
On a Mac it is something like:
cd "/Applications/Arduino.app/Contents/Java/hardware/"
When I install the adaptor it's giving me a message that the drivers are not installed for this device, do this mean that I need to install the Thomas Fischl driver?
Also I'm slightly confused as to what I am supposed to do, do I just follow this guide https://www.arduino.cc/en/Hacking/DFUProgramming8U2? Furthermore what file do I upload? I'm really confused now.
Thanks for the reply John but when following that guide I keep getting errors messages and it won't work for me. I think I'll just buy the due instead.