Serial buffer or faster processing?

Well ok, I got the point, the way I'm using is not good.

I forgot to mention that actually I'm not able to control the data which is being sent from an external software (not made by me). This software enables and disables single leds by sending that code and therefore I can't control the excessive number of bytes being sent. I agree a binary code (8 chars) would fit it. However, I can't control this (the sender).

What could then be a possible way to correctly read from serial? I'm not a programmer and the quality of my code reflects it :slight_smile:

Thanks for your time