File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 11# arduino-timer
2- Non-blocking abstracted timer library for use instead of the blocking delay() function.
2+ Non-blocking abstracted timer library for use instead of the blocking ` delay() ` function.
33
44## How to use
55...
6+
7+
8+ ### Optional: Overflow Compensation
9+ By using ` timer.start(0, true) ` (only change from 0 if you want to set a custom
10+ starting point) you can activate overflow compensation which can recover over 2
11+ timer intervals to an expected rythm if some blocking code took longer than one
12+ timer interval.
13+
14+ ** Rythm example with 1000ms Timers:**
15+
16+ ``` NO COMPENSATION
17+ ┌──┐ ┌───┐ ┌──┐ ┌───────────┐┌─┐ ┌─┐
18+ │ │ │ │ │ │ │ ││ │ │ │
19+ ─┴──┴────┴───┴───┴──┴────┴───────────┴┴─┴─────┴─┴────▶
20+ 0 1 2 3 4 5 6 Seconds
21+ ┌─────┐ ┌─────┐ ┌─────┐ ┌──────────┐ ┌─────┐ ┌─────┐
22+ └─────┘ └─────┘ └─────┘ └──────────┘ └─────┘ └─────┘
23+ ```
24+
25+ ``` COMPENSATING (recovers to expected rythm)
26+ ┌──┐ ┌───┐ ┌──┐ ┌──────────┐┌─┐ ┌───┐ ┌─┐
27+ │ │ │ │ │ │ │ ││ │ │ │ │ │
28+ ─┴──┴────┴───┴───┴──┴────┴──────────┴┴─┴─┴───┴───┴─┴▶
29+ 0 1 2 3 4 5 6 Seconds
30+ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
31+ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘
32+ ```
You can’t perform that action at this time.
0 commit comments