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.cpp
- Revision:
- 2:c7d984193741
- Child:
- 8:de7934ec7ea2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gesture/GestureInfo.cpp Thu Oct 08 11:14:18 2015 +0000 @@ -0,0 +1,41 @@ +#include "GestureInfo.h" + +void GestureInfo::set(char * value) +{ + data = value; +} + +int GestureInfo::getRecognizedGesture() +{ + return data[0]; +} + +int GestureInfo::getGestureClass() +{ + return (data[1] & 0xF0) >> 4; +} + +bool GestureInfo::isEdgeFlick() +{ + return (data[2] & 0x01) == 0x01? true: false; +} + +bool GestureInfo::isHandPresence() +{ + return (data[3] & 0x08) == 0x08? true: false; +} + +bool GestureInfo::isHandHold() +{ + return (data[3] & 0x10) == 0x10? true: false; +} + +bool GestureInfo::isHandInside() +{ + return (data[3] & 0x20) == 0x20? true: false; +} + +bool GestureInfo::isRecognitionInProcess() +{ + return (data[3] & 0x80) == 0x80? true: false; +} \ No newline at end of file