View Single Post
  #1   Spotlight this post!  
Unread 16-04-2010, 17:38
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: CAN ANYONE HELP ME PLEASE??

Quote:
Originally Posted by Radical Pi View Post
Huge flaw in your code. Here's a hypothetical situation based on the first one shown:

Button is 6 is pressed. The motor is set to 1.0. However, almost immediately after that, button 7 is checked and most likely set to 0.0.

Here's what I think you want:

Code:
if (ThirdStick->GetRawButton(6)) {
    ArmRelease->Set(1.0);
} else if (ThirdStick->GetRawButton(7)) {
    ArmRelease->Set(-1.0);
} else {
    ArmRelease->Set(0.0);
}
Also, I assume you mean if instead of while in that second code block. That version would only activate button 7 mode if button 6 was pressed
THANKS ALOT MAN!!!!, I FORGOT ALL ABOUT ELSE IF STATEMENTS
Reply With Quote