View Single Post
  #10   Spotlight this post!  
Unread 23-01-2011, 19:52
DiscoKittyPrime DiscoKittyPrime is offline
Registered User
AKA: Joshua Bryant
FRC #0057 (Leopards)
Team Role: Programmer
 
Join Date: Dec 2010
Rookie Year: 2003
Location: Houston, Tx
Posts: 26
DiscoKittyPrime will become famous soon enough
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.
Reply With Quote