I am trying to read from a ps2 barcode scanner (Datalogic gryphon D). The Arduino is powered by the USB. The circuit is shown below
The pinout of the ps2 is
I have used the fritzing pin assignments when making the diagram.
I am using the code from here
#include <PS2Keyboard.h>
const int DataPin = 8;
const int IRQpin = 5;
PS2Keyboard keyboard;
void setup() {
delay(1000);
keyboard.begin(DataPin, IRQpin);
Serial.begin(9600);
Serial.println("Keyboard Test:");
}
void loop() {
if (keyboard.available()) {
// read the next key
char c = keyboard.read();
Serial.print(c);
}
}
The scanner scans and indicates that the scan was successful. The Arduino code shows "Keyboard Test:", but none of the scans show anything. What am I doing wrong?