Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Loom_ZXGesture.h
1#pragma once
2
3#include <ZX_Sensor.h>
4
5#include "../I2CDevice.h"
6#include "Loom_Manager.h"
7
14 protected:
15
16 void power_up() override {};
17 void power_down() override {};
18
19
20 // Manager controlled functions
21 void measure() override;
22 void initialize() override;
23 void package() override;
24
25 public:
26
30 struct Position{
31 uint8_t x;
32 uint8_t z;
33 };
34
38 enum Mode {
39 POS,
40 GEST
41 };
42
50 Manager& man,
51 int address = 0x10,
52 bool useMux = false,
53 Mode mode = Mode::POS
54 );
55
59 const char* getGesture() {return gestureString; };
60
64 uint8_t getGestureSpeed() { return gestureSpeed; };
65
69 Position getPosition() { return pos; };
70
71
72
73 private:
74 Manager* manInst; // Instance of the manager
75 ZX_Sensor zx; // ZX sensor instance
76
77 Mode mode; // Current mode of the sensor
78 Position pos; // Position measured by the sensor (X and Y) in mm
79
80 GestureType gesture; // Last measured gesture
81 char gestureString[10]; // String name of the last gesture
82 uint8_t gestureSpeed; // The speed at which the gesture was preformed
83};
Definition: I2CDevice.h:6
Definition: Loom_ZXGesture.h:13
Mode
Definition: Loom_ZXGesture.h:38
Position getPosition()
Definition: Loom_ZXGesture.h:69
const char * getGesture()
Definition: Loom_ZXGesture.h:59
uint8_t getGestureSpeed()
Definition: Loom_ZXGesture.h:64
Definition: Loom_Manager.h:18
Definition: Loom_ZXGesture.h:30