![]() |
Limit Switch Programming Help
Hi Guys,
We are building a catapult mechanism to shoot the ball and to set the position of the catapult to ready to shoot, we are using a limit switch. I want the program to run 2 motors until the limit switch is on while i'm pressing a button on joystick, so the catapult will stop itself when it's stretched enough. I wrote this in teleop, but it didn't work. Where am i wrong? I wrote their begin and finish parts as well. ![]() |
Re: Limit Switch Programming Help
Are you by any chance using Jaguars? You could always wire your limit switch directly to the inputs on the Jaguar itself and let it do all the work.
On the other hand, how is your limit switch wired? Remember that the Digital Sidecar inputs are always pulled high until you pull them low. Wire your limit switch with the signal wire going to COM and the negative wire to the NO terminal. With this wiring, you will also need to switch your comparison values (switch the 0 and 1) so that when the switch is pressed (goes false) it will stop your motors |
Re: Limit Switch Programming Help
Quote:
Are you sure your limit switch is giving you True and False values in the direction you expect? Use the Test mode and view the switch's value on the Dashboard to see what it really does. |
Re: Limit Switch Programming Help
Quote:
|
Re: Limit Switch Programming Help
Quote:
|
Re: Limit Switch Programming Help
Where have you put this code (Teleop, Periodic Tasks)?
What does your Begin look like for creating the motor? |
Re: Limit Switch Programming Help
The code you posted looks okay. Is there somewhere else in the program that might be continually turning off your winch motors, like in Periodic Tasks? Is the case input connected directly to a joystick button, or is there some other processing before it reaches the case?
Is your motor wiring correct, with both motors turning in a direction that doesn't make them fight each other? Install only one winch motor circuit breaker and try running it, then remove that breaker and install one on the other winch motor. Do the motors run as expected one at a time? |
Re: Limit Switch Programming Help
Quote:
Not in Periodic Tasks, but in Teleop I was controlling those motors with one more button as well. I solved this by combining two case. So now, when i m not pressing that button, the motors aren't set themselves to 0 value. Thanks for your help. |
| All times are GMT -5. The time now is 09:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi