How can I simplify this simple code? (Again...)

AWOL:

delay(0.5); // need delay to prevent gibberish

Sadly, delay takes an integer parameter

If OP really wants half a millisecond delay, they look into the delayMicrosecond.