View Single Post
  #2   Spotlight this post!  
Unread 16-04-2010, 17:30
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: CAN ANYONE HELP ME PLEASE??

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
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote