View Single Post
  #9   Spotlight this post!  
Unread 10-02-2009, 22:41
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Digital Inputs + Auton?

Quote:
Originally Posted by byteit101 View Post
looks like you wired it sideways on the DSC
Nope. It's hard to decode, but it looks as though those horizontal cables are all signal wires. There's one cable that connects to the ground and 5v like we are used to seeing, and then the rest of the cables are the signal wires for the rest of the switches. There is a unified ground; this is a conservative design.

Assuming everything is wired properly, when the switch is CLOSED, you will get a ZERO from the digital input, and when it is OPEN, you will get a ONE. I emphasize because it is backwards from common sense.

Now, you did mention that the else is never executed, regardless of the state of the switch.
  • Stupid question: does anything else on that sidecar work? If the PWM outputs on it work OK, then something else is the matter.
  • You should check that the switches are operating as you expect. Put a multimeter in the mode to measure ohms. Put one probe on the center terminal and the other on the terminal you have wired to the signal pin. With the switch one way, it should read either 0 ohms, or something close. The other way, it should read infinite--on my meter, it reads "0 F" when it is infinite (this should be the same display it has with the probes in the air, not touching each other).
  • You can measure (in the volts mode) what the voltage is between the signal pin and the ground. It should read 5v when the switch is open, and 0v when closed.
  • You can repeatedly print the state of the input, but I don't quite know how to do this yet. If you need help, I will figure it out.

If all else fails, post back here and somebody will help.

Jacob

edit: AND SEE ALAN'S POST. I neglected to realize this situation; as he says, if you aren't wiring the common wire to ground, you will always see a 1 coming in that input. Thanks, Alan.
__________________
Aren't signatures a bit outdated?

Last edited by JBotAlan : 11-02-2009 at 01:26.