Trying to control an 8x8 LED matrix according to Arduino.cc example

Wait...

Sorry, you are sending the numbers as ascii encoded. I just realised 48 = "0" and 52 = "4".

So parseInt was right. But I would still recommend checking available () >= 4.