-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTapTempo.h.orig
46 lines (40 loc) · 1.04 KB
/
TapTempo.h.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef TapTempo_h
#define TapTempo_h
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
#include <movingAvg.h>
typedef void (*valueEventHandler)(int);
typedef void (*beatEventHandler)();
class TapTempo
{
public:
TapTempo();
<<<<<<< HEAD
void setup(unsigned long defaultResetTimeSpan, unsigned long minTapDiffTimeSpan);
=======
void setup(unsigned long defaultResetTimeSpan, int beatSubdivisions);
>>>>>>> 341915eff515f62efb5af081fae11839e117feb7
bool tap();
void flush();
void reset();
void valueUpdatedHandler(valueEventHandler handler);
void beatHandler(beatEventHandler handler);
int getLastValue();
private:
unsigned int _lastValue;
unsigned int _tapCounter;
unsigned long _lastTapTime;
unsigned long _resetTime;
unsigned long _defaultResetTimeSpan;
unsigned long _minTapDiffTimeSpan;
unsigned long _resetTimeSpan;
unsigned long _beatTime;
int _beatSubdivisions;
movingAvg tapTimeFilter;
valueEventHandler _valueUpdated;
beatEventHandler _beat;
};
#endif