I have put together a “joystick” or a “button” by soldering a PWM to a micro switch(from the KOP). However, we cannot get the robot to read the button input. We do not believe the code is wrong (It might be wrong) and I’m wondering if its just the way the micro switch is connected to the Driver Station. I did a continuity test and it does have current flowing through it when the switch (button) is pressed. Is it possible to use the micro switch as a button for shooting? Is using a PWM the problem? Please reply ASAP
This year, the driver station does not have pull-up or pull-down resistors on the digital inputs therefore they tend to float at an undefined state when no voltage (or ground) is applied.
Here’s a diagram showing how switches connected to the Driver Station digital inputs can be connected successfully. Note, this does not necessarily apply to the cRIO digital inputs since they do have pull-up inputs.
see here:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=7369&stc=1&thumb=1&d=1234143000
Disregard this response please.
how did you connect it? I think the way you want to connect it is to have the NO connected to red, NC to black, and COM to white. This will switch the signal input wire from ground to +5v when you push the button.
If you connected it a different way, let us know.
Do you have a pullup resistor for it? This years OI (or DS if you prefer) doesn’t have them built in like previous years.
If you connect all three terminals, you don’t really need the pullup resistor, but if you only connect two, you might need it…depending on how you connect it.
I connected the white signal of the PWM to the top left plug (when the ground is on the left and the metal switch is pointing down on the right)
I also connected the black ground of the PWM to the plug sticking out the left side.
I have not connected the red wire of the PWM anywhere is this the problem?
When connected to the DS, it is placed in the Analog section, 1 slot right of the black plastic piece, with ground…well facing the ground (on the bottom)
ill try to get pictures ASAP
The switch has two terminals next to each other, they are NC and NO (normally closed and normally open). There is a third terminal on the other side of the switch, which is COM (common). If you connect the white signal wire to COM, the NC to the black wire, and the NO to the red wire, then it will switch the signal from ground to +5 when the lever is pressed.
The way you have it now, there is no voltage going to the signal input, so it will not show anything in the program when you close the switch.