You could simply use a counter.
And instead of these if .. else if I would use a switch statement.
You need less ISR overhead if you let OCR1B switch your output.
You could simply use a counter.
And instead of these if .. else if I would use a switch statement.
You need less ISR overhead if you let OCR1B switch your output.