You should post your code; this is what my team is using at the moment:
Code:
if(driveStick.GetRawButton(5) && topLimit.Get() == 1) //The arm will only move up if the limit switch is NOT pressed
{
leftArm.Set(-1.0); //Moves the arm up
rightArm.Set(-1.0);
}
else if(driveStick.GetRawButton(7) && bottomLimit.Get() == 1) //ditto ^
{
leftArm.Set(0.5); //Moves the arm down
rightArm.Set(0.5);
}
else
{
leftArm.Set(0.0); //Stops moving the arm
rightArm.Set(0.0);
}
The way we wired our limit switch makes it so then when the limit switch is pressed, it is equal to "0" and when it is not pressed, it is equal to "1"