Decoding stream containing hex-values received on Serial port.

ardly:
Maybe you are making this more complicated than it needs to be.

Think of each printing ASCII character as representing 4 bits or pixels.

So storing an array of 32 characters would give you the data needed to print one line of 128 pixels (where the pixel is either on or off no colour).

Printing with the actual data i have under control. It works. I have an array with 16 bytes and they correspond to the bytes sent to the print head.

The reason that i cannot split up the received bytes into 4-bit packages is that the file i receive is one byte for the first 8 pixels and so on.

It's the interpretation of the serial string that is giving me problems. I can't realise it in my head how to do it elegantly.

// Per.