still the motor controlled by 3Dconnexion navigation

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
baoqger
Posts: 7
Joined: Fri Sep 03, 2010 8:10 pm

still the motor controlled by 3Dconnexion navigation

Post by baoqger »

void ProcessWM_INPUTEvent( LPARAM lParam )
{
.
.
.
if (pRawHid->bRawData[0] == 1) // Translation vector
{
all6DOFs[0] = (pRawHid->bRawData[1] & 0x000000ff) | ((signed short)(pRawHid->bRawData[2]<<8>bRawData[3] & 0x000000ff) | ((signed short)(pRawHid->bRawData[4]<<8>bRawData[5] & 0x000000ff) | ((signed short)(pRawHid->bRawData[6]<<8) & 0xffffff00);
bGotTranslation = TRUE;
motor();// call the funciton
}
.
.
.

}

void motor()
{
.
.
while(all6DOF[0]) // all6DOF[0] is the translation vector component of in the direction of "left and right"
{Movemotor();}// when the vector component in the direction is not zero keep moving the motor
Stopmotor();// when the vector component turns to zero, stop the motor
}

so the expented result is push the cap, and the motor start; release it the motor stops. But the real result is the motor
keep going on,becasue the value all6DOF[0] still have some value.
Post Reply