FastLED
3.9.3
Loading...
Searching...
No Matches
timer.h
1
#pragma once
2
3
#include <stdint.h>
4
5
class
Timer
{
6
public
:
7
Timer
() : start_time(0), duration(0), running(
false
) {}
8
void
start(uint32_t now, uint32_t duration) {
9
start_time = now;
10
this->duration = duration;
11
running =
true
;
12
}
13
bool
update(uint32_t now) {
14
if
(!running) {
15
return
false
;
16
}
17
uint32_t elapsed = now - start_time;
18
if
(elapsed > duration) {
19
running =
false
;
20
return
false
;
21
}
22
return
true
;
23
}
24
25
private
:
26
uint32_t start_time;
27
uint32_t duration;
28
bool
running;
29
};
Timer
Definition
timer.h:5
examples
NoiseRing
timer.h
Generated on Thu Nov 14 2024 00:00:34 for FastLED by
1.11.0