ps2 barcode scanner using instantly

byte scanCodes[10] = {0x45,0x16,0x1e,0x26,0x25,0x2e,0x36,0x3d,0x3e,0x46}; char characters[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};

If you worked for me, this would get you some time off. ONE statement per line!

Use the space bar to make the code readable. Also feel free to break that array initialization code onto more than one line. 2 groups of 5 is much easier to count than one group of 10.

String inputString = "";         // a string to hold incoming data

This would too. Strings have major problems on the Arduino, and are a crutch, anyway.

  // reserve 200 bytes for the inputString:
  inputString.reserve(200);

This part says that you have an idea how big the static array should be. Go with that!

  // rebuild the picture after some delay

Comments after the code look pretty stupid. Comments BEFORE the code are a good idea.

//run barcode scanner 
if(number==5)
{
checkBarcode();
//checked=true;
}

Why
only
when
number
is
five?

What's
magic
about
five?

How
does
number
get
to
be
five?

I give up on the rest of that mess. The indentation is horrid. Put each { on a new line, and use Tools + Auto Format AND some comments if you really want help.