|
Limit Switches
Hey guys,
We're trying to get limit switches working, where if the limit switch is hit, the motor can only turn in the other direction or sit dead, and if the pilot tries to turn the motor in the direction of the limit switch, the motor would just stop.
I have attached the vi for the code and have attached a picture of where the code gets an error. The error occurs in the second Case structure where the limiting values are from 0, 1. The problem is that when the Joystick has a value not within the 0-1 range (somewhere from -1 to 0) it does not turn in the other direction or stop, it keeps jerking and turning in the negative direction.
Just some other information, we're using a Victor wired to PWM 3 on Digital Sidecar at Slot 4, and are using the USB 3 Joystick port to control the motor, which is a CIM. The limit switches are in Digital I/O ports 9 & 10.
I looked at all the different points to see if the values were what I programmed them to be, and it seemed as though they were, which leads me to believe that it's a hardware problem.
Has anyone had a similar problem or knows how to fix the problem?
Really appreciate your help.
Thank you,
Sravan
__________________
I am an employee of FIRST. However, the postings on this site are of my own perspective as a FIRST mentor and volunteer and do not necessarily reflect the views of FIRST.
FIRST Team 5125 Hawks on the Horizon Lead Mentor
FRC Team 4096 Ctrl-Z Former Mentor
FTC Team 5203 #19@! Former Mentor
FRC Team 1403 Cougar Robotics Alumni
|