Monday, December 04, 2006

Gesture Recognition

I think the code would look something like this. oldMotion I guess would be manually inputed in the Arduino code. newMotion would need a "for loop" to store the data. Would it be better to create two arrays, one for X and one for Y? Will the 8-bit chip be able to handle all this? If swirlGate became true the lights would swirl. The +/- 5 is arbitrary. This does not compensate for speed.



int testVal = 0;
int newMotion[100];
int oldMotion[100];
boolean swirlGate = false;

void recognizeSwirl(){
for(int z = 0; z > 100; z++){
//check new array to old
testVal = abs(newMotion[z] - oldMotion[z]);
if(testVal<5) swirlGate = true;
else swirlGate = false;
}
}

0 Comments:

Post a Comment

<< Home