mahmosh
12-02-2009, 09:12
hey
we are trying to do 2 buttons for the same motor if button 1 pressed move forward .. else stop ... and then if button 2 pressed move backward else stop
here is the code we are using but it doesn't work well :
in the operatorcontrol we put this:
if(leftjoystick->GetRawButton(1));
{
jaguar->Set(1.0);
}
else{
jaguar->Set(0.0);
}
if(leftjoystick->GetRawButton(2));
{
jaguar->Set(-1.0);
}
else{
jaguar->Set(0.0);
}
what is the problem with this ?? if we deleted the second part
if(leftjoystick->GetRawButton(2));
{
jaguar->Set(-1.0);
}
else{
jaguar->Set(0.0);
}
everything working ok!!
please need answer
we are trying to do 2 buttons for the same motor if button 1 pressed move forward .. else stop ... and then if button 2 pressed move backward else stop
here is the code we are using but it doesn't work well :
in the operatorcontrol we put this:
if(leftjoystick->GetRawButton(1));
{
jaguar->Set(1.0);
}
else{
jaguar->Set(0.0);
}
if(leftjoystick->GetRawButton(2));
{
jaguar->Set(-1.0);
}
else{
jaguar->Set(0.0);
}
what is the problem with this ?? if we deleted the second part
if(leftjoystick->GetRawButton(2));
{
jaguar->Set(-1.0);
}
else{
jaguar->Set(0.0);
}
everything working ok!!
please need answer