How to eliminate Wait and While?
Two simple approaches:
- use interrupts: you can think of interrupts as a simple way to prioritize tasks;
- use cycle counters: it is essentially a state machine approach;
Do I use a lot of interrupts?
I use interrupts extensively - they make coding so much simpler.