Extract waiting into a separate operation.
Get and reset motor counter.