The past few days I’ve been trying to connect a barcode scanner with my Arduino Uno, but I have failed.
I connect the barcode scanner to my Arduino using a USB to PS/2 adaptor.
I tried three different codes to get the barcodes read from the barcode scanner but none of them worked.
1st: Using PS2Keyboard library and connecting the Datapin to pin 3 and Clockpin to pin 2 (the pins stay the same for the rest)
2nd: I followed a tutorial from instructibles .
3rd: Using the example from arduino playground.
2 and 3 are basically the same but anyway.
To make sure the adaptor is working (or at least the code) I tested it with a keyboard (using the PS2Keyboard library). Actually, two keyboards. With the first one I couldn’t get any input, but with the second one, which was a microsoft keyboard, worked perfectly (don’t know why though).
I cannot provide any links for the barcode scanner because I can only find it from e-shops from my country (non-englsih). It has a manual with some barcodes-options and it has Transmission Modes for USB mode (USBHID) and PS/2 mode.
When I connect the barcode scanner via a USB port with my PC it works perfectly. Haven’t tested it with a PS/2 on my PC though.
So, anyone knows what may be the problem?
Of course I have searched the forums but found nothing to help me.
Thank you in advance.