Timing is off with a non-blocking delay

Well that's better but I think you just got it within the 4 µS interval.

The timer would allow smooth transitions without the issue of the 4 µS granularity.