wiring the 2010 digital limit switches

we currently have a didgital limit switch wired to that it’s normally open and we’ve wired it in to our kicker system but when we tested the limit switch it doesn’t seem to work right. can someone possibly post a link to a wiring diagram… much thanks from team 818:)

One wire from the limit switch goes to signal on a Digital Input on the Digital Sidecar.
One wire from the limit switch goes to ground on a Digital Input on the Digital Sidecar.

What Mark said… if you post a picture of your wiring, we may be able to see what the issue is.

If you actually mean “it dosen’t work right” instead of just “it dosen’t work at all”, maybe its a simple software thing you overlooked.

All inputs on the DSC are pulled high. That means when unconnected, they will be 1 and not 0. Since you have the limit switch wired NO, between GND and SIG, when the switch is not pressed it will be 1. Then when it is pressed it will be 0. If you are wiring this to a PWM cable, connect the White and Black wires to the COM and NO on the limit switch. Put something on the black wire so it dosen’t touch anything, electrical tape works. It dosen’t matter which way you insert it or what wire goes to what because the circuit is either made or broken between the outer two pins. How are you reading it in software?

Visuals are always awesome!

http://img.skitch.com/20100219-ntrqfw15ucg9fparb2fugjrr1y.jpg

So here’s the explanation…

NC = Normally Closed
NO = Normally Open

When you push the switch, it disconnects COM and NC and connects COM and NO. Otherwise, NC and COM are connected.

The Digital Sidecar has something called “Internal Pull-ups”. This means that when the signal wire (the white one) isn’t connected to anything, it will read logical true. However, when you push the switch, the connection to ground (the black wire) overrides this internal pull-up and pulls it to logical false. The heatshrink on the red wire is to prevent any shorting. In reality, it’s not a big deal, but it’s safer that way.

What does this mean for code? Well, here’s some pseudocode to explain it:

If limitSwitch is False
Do what you’re supposed to do when the switch IS triggered
Else
Do what you’re supposed to do when the switch is NOT triggered

I know it seems backwards, but you’ll get used to it. If you need language specific help, feel free to message me (or post back, whatever you’re most comfortable with).

Hi Im Joe from team 3017
we are now trying to use the limit switch. However, do you know how to program it? Or where to find the file in WPILib. By the way, I’m using C++.
THANKS

We have set up our robot exactly how you did this, wiring wise and then we had setup our limit switch exactly how the frcmastery.com video said to do it.

How we have our robot setup.

  • a kicker is pulled back(by a victor) until limit switch is pushed
  • victor then reverses until a limit switch 2 is pushed
  • then waits for a button to be pushed (and the kicker is released.(this is irrelevant))

We can’t get step 1 to even happen.
From everything we have looked up it looks good multiple tutorials past examples above examples.

How do we get (this) to happen (when) (limitSwitch) is pushed?