My project is where I need to interface a bar code reader with a mega2560. I have the option to use either a
PS2 or a USB device. My question is, can I use the Keyboard Library to read data from the scanner ?. Is yes, then what is the method to store this value in a variable, since I'll be checking it against a set value.
One more question is, if I use a USB based scanner, then I know I'd have to use a USB Host Shield, but will I have to make too many changes to the earlier program to adapt to the USB addition ?
The keyboard program I'm referring to is : http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html