|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Trouble with limit switches
So basically we can't get a change in value when the limit switch is pressed.
We have one end of the limit switch wired to signal and the other to ground on the Digital Inputs on the Digital Sidecar. We are using Java for our programming. Heres the code pulled out from robotInit and teleopPeridodic: Code:
private DigitalInput limit;
limit = new DigitalInput(1);
System.out.println("ingest switch: " + limit.get());
If someone has any idea on what to try it would be helpful. We are gonna try a new digital sidecar tomorrow and see if that works. |
|
#2
|
||||
|
||||
|
Re: Trouble with limit switches
One symptom of a broken ribbon cable is bad I/Os. Do a continuity test on each of the pins. This exact thing happened to us and cost over an hour at competition.
|
|
#3
|
|||||
|
|||||
|
Re: Trouble with limit switches
Measure the voltage on the DIO signal pin. It should change when you flip the switch.
Is the Digital Sidecar correctly powered? The 5V light needs to be shining bright in order for the inputs to work. |
|
#4
|
|||
|
|||
|
Re: Trouble with limit switches
Quote:
Quote:
We have other IO pins being used with encoders that are working perfectly fine. Whenever we try to use a limit switch on any of the pins, it doesn't work. I can try a new ribbon cable later today and see if that works. Last edited by tyler34 : 18-06-2013 at 11:40. |
|
#5
|
||||
|
||||
|
Re: Trouble with limit switches
Quote:
1. Double and triple check the code to make sure you aren't assigning something else to that pin as well. 2. Try creating a whole new software project that has nothing in it but the limit switch code, to make sure you aren't running into any issues with other stuff interfering. 3. Unplug your limit switch and verify it's working as intended - use a multimeter to measure resistance between the two pins on the PWM connector - you should see the resistance value switch between infinite and 0 ohms when pressing the switch (as for which one is which, that's up to how it's wired - normally connected or normally open). 4. Check the LED's on the DSC - all three should be brightly lit (5V, 6V and Power), and you should see the RSL working correctly. 5. Take spares of other parts (DSC, DSC-cRIO cable, etc) and swap them out to make sure the problem isn't in one of them. |
|
#6
|
|||
|
|||
|
Re: Trouble with limit switches
Quote:
|
|
#7
|
||||
|
||||
|
Re: Trouble with limit switches
It's not working because you are supposed to connect the switch to SIG and POWER.
|
|
#8
|
||||||
|
||||||
|
Re: Trouble with limit switches
Quote:
I also guess that something is wrong with power. Follow Alan's suggestions. |
|
#9
|
||||
|
||||
|
Re: Trouble with limit switches
Quote:
In my defense, I don't think I've used a custom digital input. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|