I don't know if I posted this in the wrong place, please let me know if I did. I have been thinking about this problem, and have a bit of an idea of what I want to do.
First step would be to detect the direction of a voluntary motion. To do this I was thinking of the following (in sudo code).
threshold = # (how much the force needs to change before it is considered voluntary)
vals = readSensor
init_x = vals[xforce]
init_y = vals[yforce]
init_z = valz[zforce]
vals = readSensor
x = vals[xforce]
y = vals[yforce]
z = valz[zforce]
diff_x = x-init_x
diff_y = y-init_y
diff_z = z-init_z
if(diff_x>threshold): #Moved right
if(dir_x<threshold*-1): #Moved left
if(dir_y>threshold): dir = #Moved up
if(dir_y<threshold*-1): #Moved down
if(dir_z>threshold): #Moved forward
if(dir_z<threshold*-1): #Moved back
That is my basic idea for determining that there was a voluntary motion in a certain direction. From there, I would give an amount of time to wait for the next motion (milliseconds probably). Record the sequence of motions, and look to see if that sequence matched a pre-defined sequence. If it does, then fire a specific IR code.
I have never worked with accelerometers before, so I am sure I am missing something here. I realized the fact that the accelerometer sensor will detect gravity, but this should account for that. I might code this up for my phone soon to test it out.
I am interested in hearing opinions if anyone has them.
Thanks.