Bug in decoding MotionPlus data

Mar 8, 2011 at 10:11 PM
Edited Mar 8, 2011 at 10:20 PM

Sorry for my English, I use a translator

There is a problem with the data coming out of the MotionPlus.

I am using the code proposed : The accuracy is improved

mWiimoteState.MotionPlusState.RawValues.X = buff[offset + 0] | ((buff[offset + 3] & 0xfc) << 6);
mWiimoteState.MotionPlusState.RawValues.Y = buff[offset + 1] | ((buff[offset + 4] & 0xfc) << 6);
mWiimoteState.MotionPlusState.RawValues.Z = buff[offset + 2] | ((buff[offset + 5] & 0xfc) << 6);

but the data are increased (not to exceed a value) . From a certain value (unknown to me), we have a subtraction which appears ... You can see a jump : http://mecatools.dfournier.free.fr/image.png

I do not have the level to find the error and I need the corrected code for my students

Thank you for your help


David