![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Cubic Hand project for EECS 249A course.
Dependencies: MMA8451Q TSI cc3000_hostdriver_mbedsocket NVIC_set_all_priorities mbed Multi_WS2811
Diff: GestureRecognition.cpp
- Revision:
- 52:0f7a239cdd09
- Parent:
- 51:09796a9ee78d
diff -r 09796a9ee78d -r 0f7a239cdd09 GestureRecognition.cpp --- a/GestureRecognition.cpp Thu Dec 11 18:33:50 2014 +0000 +++ b/GestureRecognition.cpp Thu Dec 11 21:22:42 2014 +0000 @@ -20,8 +20,8 @@ returnParams.deltaX = 0; returnParams.deltaY = 0; returnParams.deltaZ = 0; - float fingerThreshold = 50.0; - float thumbThreshold = 20.0; + int fingerThreshold = 500; + int thumbThreshold = 200; if (++counter >= MAX_COUNT) { returnParams.size = 4; secondCounter++; @@ -46,9 +46,12 @@ else if ((!fBent[0]) && (!fBent[1]) && (!fBent[2]) && (!fBent[3]) && fBent[4]) returnParams.size = 8; //Change color - // else if (data.fingers[0] > fingerThreshold && data.fingers[1] > fingerThreshold && data.fingers[2] > fingerThreshold && data.fingers[4] > fingerThreshold ) { - //returnParams.hue = data.fingers[3]/150.0; - // } + else if (fBent[0] && (!fBent[1]) && (!fBent[2]) && (!fBent[3]) && (!fBent[4])) + returnParams.hue = 25.0/100.0; + else if (fBent[0] && fBent[1] && (!fBent[2]) && (!fBent[3]) && (!fBent[4])) + returnParams.hue = 75.0/100.0; + else if (fBent[0] && fBent[1] && fBent[2] && (!fBent[3]) && (!fBent[4])) + returnParams.hue = 100.0/100.0; //Change position. Roll, pitch, and yaw are given as degrees. if (data.roll > 10 )