aboutsummaryrefslogtreecommitdiff
path: root/arduino/Counter.h
diff options
context:
space:
mode:
authorMarc Sunet <msunet@shellblade.net>2022-12-01 10:38:12 -0800
committerMarc Sunet <msunet@shellblade.net>2022-12-01 10:38:12 -0800
commit8543b0f9df2e527cb242d0629d5b5574c0d76d30 (patch)
tree2d7e76478017cea9972afe8450e1213bc38d3a05 /arduino/Counter.h
parente62be3b12d3c94d709a77d89f52c31f7c4ac475d (diff)
Move arduino program to rpmcount folder and rename cc files to cpp as the IDE expects.HEADmain
Diffstat (limited to 'arduino/Counter.h')
-rwxr-xr-xarduino/Counter.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/arduino/Counter.h b/arduino/Counter.h
deleted file mode 100755
index f832023..0000000
--- a/arduino/Counter.h
+++ /dev/null
@@ -1,45 +0,0 @@
1#pragma once
2
3class Counter
4{
5public:
6
7 enum State
8 {
9 READY,
10 WAITING_FOR_TIMEOUT,
11 COUNTING,
12 SIGNALING
13 };
14
15public:
16
17 void init (unsigned long startDelay, unsigned long rpmCount, unsigned long signalsPerRPM);
18
19 void setStartDelay (unsigned long);
20
21 void setRPMCount (unsigned long);
22
23 void setSignalsPerRPM (unsigned long);
24
25 void start (unsigned long startTime);
26
27 void reset ();
28
29 void update (unsigned long time, int rpmSignal);
30
31 State getState () const;
32
33private:
34
35 State state;
36
37 unsigned long startDelay;
38 unsigned long rpmCount;
39 unsigned long signalsPerRPM;
40 unsigned long startTime;
41
42 unsigned long signals;
43
44 bool lastRpmSignal;
45};