The delayMicroseconds is called twice. I changed it to only have one delay but its not changing the flickering much.