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?
second question of 3Dmouse control motor
Moderator: Moderators
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?
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?
