Don't use delay() or delayMicroseconds(). See how timing is managed in the demo Several Things at a Time. The same technique also works with micros().
It will automatically allow for the time taken by your code.
...R
Don't use delay() or delayMicroseconds(). See how timing is managed in the demo Several Things at a Time. The same technique also works with micros().
It will automatically allow for the time taken by your code.
...R