forked from toniebox-reverse-engineering/hackiebox_cfw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BoxAccelerometer.h
45 lines (36 loc) · 970 Bytes
/
BoxAccelerometer.h
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
#ifndef BoxAccelerometer_h
#define BoxAccelerometer_h
#include "BaseHeader.h"
#include <EnhancedThread.h>
#include <SparkFun_MMA8452Q.h>
class BoxAccelerometer : public EnhancedThread {
public:
enum class Orientation {
EARS_UP = 0x7,
EARS_DOWN = 0x5,
EARS_FRONT = 0x3,
EARS_BACK = 0x0,
EARS_LEFT = 0x2,
EARS_RIGHT = 0x1,
OTHER = LOCKOUT,
EARS_UP2 = 0x6,
EARS_DOWN2 = 0x4
};
enum class TapFrom {
LEFT,
RIGHT, //17,34,68 - 34
FRONT, //16, 17
BACK,
TOP, //16,32,64,68,24 - 16
BOTTOM //17
};
void
begin(),
loop(),
reloadConfig();
BoxAccelerometer::Orientation getOrientation();
private:
MMA8452Q _accel;
BoxAccelerometer::Orientation _orientation;
};
#endif