The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller
Dependents: NucleoMGC3130 i2c_master
Diff: Gesture/GestureInfo.h
- Revision:
- 1:621c4e9238ef
- Child:
- 2:c7d984193741
diff -r 92f17b057d6b -r 621c4e9238ef Gesture/GestureInfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gesture/GestureInfo.h Wed Oct 07 20:43:39 2015 +0000 @@ -0,0 +1,71 @@ +#ifndef UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo +#define UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo + +class GestureInfo +{ +private: + char * data; +public: + + void set(char * value) { + data = value; + } + + /* + NoGesture = 0, + GarbageModel = 1, + FlickWestToEast = 2, + FlickEastToWest = 3, + FlickSouthToNorth = 4, + FlickNorthToSouth = 5, + CircleClockwise = 6, //only active if AirWheel disabled + CircleCounterclockwise = 7, //only active if AirWheel disabled + WaveX = 8, + WaveY = 9, + Hold= 64, + Presence = 73, + EdgeFlickWestToEast = 65, + EdgeFlickEastToWest = 66, + EdgeFlickSouthToNorth = 67, + EdgeFlickNorthToSouth = 68, + DoubleFlickWestToEast = 69, + DoubleFlickEastToWest = 70, + DoubleFlickSouthToNorth = 71, + DoubleFlickNorthToSouth = 72, + */ + int getRecognizedGesture() { + return data[0]; + } + + /* + GarbageModel = 0, + FlickGesture = 1, + CirculaGesture = 2, + */ + int getGestureClass() { + return (data[1] & 0xF0) >> 4; + } + + //Edge flick – is ‘1’ if flick gesture is classified as edge flick + bool isEdgeFlick() { + return (data[2] & 0x01) == 0x01? true: false; + } + + bool isHandPresence() { + return (data[3] & 0x08) == 0x08? true: false; + } + + bool isHandHold() { + return (data[3] & 0x10) == 0x10? true: false; + } + + bool isHandInside() { + return (data[3] & 0x20) == 0x20? true: false; + } + + bool isRecognitionInProcess() { + return (data[3] & 0x80) == 0x80? true: false; + } +}; + +#endif \ No newline at end of file