This project has moved. For the latest updates, please go here.
1
Vote

ParseAccel divide by zero

description

Hi, when reading acelState, the following code divide by zero

comments

nopecio wrote Jun 25, 2008 at 12:34 AM

Sorry, i accidentally pressed enter.
As i said.. :)
        mWiimoteState.AccelState.X = (float)((float)mWiimoteState.AccelState.RawX - mWiimoteState.AccelCalibrationInfo.X0) / 
                                        ((float)mWiimoteState.AccelCalibrationInfo.XG - mWiimoteState.AccelCalibrationInfo.X0);
When parsing the accel state this code returns infinity. This happens when mWiimoteState.AccelCalibrationInfo.XG =mWiimoteState.AccelCalibrationInfo.X0, initially both are also Zero.
Best regards, and tell me if i can help on anything
Rodrigo

wrote Feb 21, 2013 at 10:55 PM