second question of 3Dmouse control motor

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

second question of 3Dmouse control motor

Post by baoqger »

As I mentioned in my first question about the same topic,in order to control the motor with 3D mouse, I done as the following code:
call the function of PICOMOTOR(which will start the motor to move with certain steps)
if (pRawHid->bRawData[0] == 1) // Translation vector
{
.
.
.
bGotTranslation = TRUE;
PICOMOTOR();
}

void PICOMOTOR()
{
.
}
But the problem is I push the cap of the 3D MOUSE and then PICOMOTOR function will be called and the motor will run. But when I let the cap return to original position, the expected result is the motor will stop. But the the motor will go on running again and again. I just add the code as mentioned before without any loop. I don't know the reason? Can you help me?
baoqger
Posts: 7
Joined: Fri Sep 03, 2010 8:10 pm

Post by baoqger »

I have tried just now, I push the cap of 3dconnexion and the transfer vector get a value ,for example 100. and I release the cap to the original position but the value still 100 instead of 0. I want to know in the wm-input example how to get the real time value of the vector.thanks.

Bao
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

You're not doing something right in there. The numbers all drop to zero when you let go.

Run our sample code. Look at the numbers w/o the motor code involved. Make sure you are opening the MultiAxis Controller.
baoqger
Posts: 7
Joined: Fri Sep 03, 2010 8:10 pm

Post by baoqger »

sorry, What do you mean by the number w/o. I can not catch it. would you please to explain it a little more?
And also you mentioned Multi axis controller, where to set it? I want to make it sure.
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Sorry, w/o = without.

Instead of sending the data to the motor code, just print it out to the console or a dialog box or a file or whatever you want. Just look at the numbers until you understand them. If you print out the value from a single axis, you should see it increase from 0 to 300 something as you increase the pressure. If you push the other direction, it will decrease from 0 to -300 something. If you aren't seeing this, you are parsing the data incorrectly.

When you let go of the cap, the value will spring back to 0.

What sample code are you starting with?
Post Reply