|
Re: Button programin C++
I am sorry, I forgot to mention that the "motors.Set()" section was just a stand in for whatever functions you use to move. You would either replace the "motors" part with the motors that you declared earlier in your program or replace the "motors.Set()" function with whatever function you were using to drive.
For example, if you declared your motors previously as LeftMotor and RightMotor, then the code would look like:
if ( !stick.GetTrigger()){
LeftMotor.Set(x);
RightMotor.Set(x);
}
else{
LeftMotor.Set(x/2);
RightMotor.Set(x/2);
}
Sorry about forgetting to include that little tidbit. If you have any more problems with your code, post a copy of the driver section so we can see what might be the problem.
|