Wait, I am not referencing a KVM that permits using one keyboard on either computer by hitting a button and switching between the two. What I am talking about is one USB keyboard to send keyboard/barcode scanner information to two computers at the same time.
That’s right! 1 USB Keyboard sending data to 2 computers at the same time. Not a PS/2, but a USB keyboard. I spent a butt load of time trying to find a device that will do this, but I couldn’t, so I built one.
In order to get this working, Arduino Due $20 (on amazon), 2x Arduino Mico Pro (3x $16 on Amazon). The rest is soldering connections, making a plastic box and cutting some holes.
The Arduino Due has the ability to read keyboard input with the correct library. The Arduino Micro Pro has the ability to emulate a keyboard. Combined using the IC2 bus communications, the Due can read keyboard input, forward it over the IC2 bus to 2 or more Mico Pros at the same time. Then have the Micro Pros read the IC2 bus as characters and send the output to the USB interface. Some tweaks were needed in the code since some keyboard keys aren’t characters. For example, TAB, ENTER, CTRL. These had to be send as the integer ascii representation to the Pro Micro.
Aside from that, it seems to work very well and has reduced out time per piece in production, human error and saved us from an over priced software interface.
Best and have fun.
Since posting the code in seems to fubar the syntax no matter what I try, I’ve attached the MASTER and SLAVE code in the zip file above. Since people keep asking. Keep in mind non characters do not send unless you code for them. I’ve only included the code for the TAB and ENTER keys. Since there are many different keyboard layouts, I just needed these for my project. If you need additional non character keys, you must add the code for them and include the if statement for translation.