Hi
usually the "data" you have depends on the sensor you are using.
Assuming that you have an MPU (a digital Motion Processor Unit) as you wrote in the "Subject" field,
the kind of data you might have on output depends on the MPU itself.
Basically they depends on the DOF (Degree Of Freedom) that the MPU has (usually 6 or 9).
Moreover, on the datasheet of the MPU (or on the board itself), it is reported a coordinate plane reporting
which is the direction of the x,y,z axes on the chip.
Usually the MPU send out raw datas, which must be manipulated to obtain the parametrizzation needed.
This can be done with some math or using an existing library (such as i2cdev: GitHub - jrowberg/i2cdevlib: I2C device library collection for AVR/Arduino or other C++-based MCUs).
This specific library has the opportunity to choose as output the data that suits our project at best.
The parametrizzation available to describe the orientation of a rigid body in 3-dimensional space are:
- raw data
- Euler's angle
- Tait–Bryan angle
- Yaw Pitch Roll (YPR)
Once that the parametrizzation is chosen (assuming that you have used the YPR representation) you have to "align" your MPU at the "segment" you need to move.
Once that this is done you only have to see your "segment" by which axes is represented on the coordinate system. With this you know if its movement is represented by the Yaw (z), the Pitch (y) or the Roll (x).
Therefore the data you need to pass to the Processing sketck depends on how you designed your system.
Hope this is helpfull