I'm currently working on a bionic hand controlled by a MMA8452Q tri-axis tilt sensor module. I'm receiving reliable data from the sensor, and the arm's grip tightens when the motor turns clockwise and loosens when it turns anticlockwise. But I would like to control it in the following way:
I want the grip to start tightening when the user raises their upper arm forward (+ve y), and it should keep tightening until they push their upper arm backward (-ve y).
Similarly, when the user pushes their upper arm backward (-ve y), I want the grip to start loosening until they push their upper arm forward (+ve y) to stop it.
(For each action, there is a minimum amount that the arm must be moved before triggering).
Any ideas/general guidance on how to code these actions efficiently?
I do not understand what kind of movement this is. What is "upper" arm?
from shoulder to ellbow?
If yes how does the shoulder-to-ellbow-part of an arm move forward without the rest???
left arm is "above" right arm = upper?
It would help a lot if you would draw some picture that show by picture what kind of movement this is.
or
if you post a sequence of measured sensor-values and how these sensor-values relate to the different movings