Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Micro Switch + PWM = Button? (http://www.chiefdelphi.com/forums/showthread.php?t=74489)

iSnoopy 14-02-2009 19:01

Micro Switch + PWM = Button?
 
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 :D

BitTwiddler 14-02-2009 19:15

Re: Micro Switch + PWM = Button?
 
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=1 234143000

BitTwiddler 14-02-2009 19:19

Re: Micro Switch + PWM = Button?
 
Disregard this response please.

MrForbes 14-02-2009 22:09

Re: Micro Switch + PWM = Button?
 
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.

phobozad 15-02-2009 00:57

Re: Micro Switch + PWM = Button?
 
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.

MrForbes 15-02-2009 10:06

Re: Micro Switch + PWM = Button?
 
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.

iSnoopy 15-02-2009 21:01

Re: Micro Switch + PWM = Button?
 
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

MrForbes 15-02-2009 23:35

Re: Micro Switch + PWM = Button?
 
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.


All times are GMT -5. The time now is 12:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi