View Single Post
  #12   Spotlight this post!  
Unread 02-17-2016, 06:27 PM
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,117
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: Issues with LimitSwitch

At the beginning of OperatorControl, you check the limit switch, and stop slidemotor if it the switch is true.

So, make sure the limit switch returns 1 (true) when it is reached, and 0 (false) when it is not.

However, you code continues to execute, and at:
Quote:
if (Math.abs(xboxController.getRawAxis(5)) > .1) {

slideMotor.set(-xboxController.getRawAxis(5));

} else {
you set the speed of the motor, without regard to the limit switch.
Reply With Quote