Go to Post But I suppose friendly reminders to read the manual are much better than sarcastic ones. - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2009, 13:53
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Digital Inputs

After a few days of frustration, I figured out what we were doing wrong with digital inputs. The digital inputs aren't "pulled down" so they read unpredictable values. Our button makes the input read "0" when pushed, which is fine, but when it's NOT pushed, the value fluctuates between 0 and 1. Is there any way we can make the "not pushed" value remain at a constant value?
We just have a switch hooked up to the signal and ground wires of a pwm cable.
Do we need resistors or something else?
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2009, 14:17
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Digital Inputs

You probably need the +5v wire connected.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2009, 14:27
nick fernandes nick fernandes is offline
Registered User
FRC #0166
 
Join Date: Jan 2009
Location: merrimack
Posts: 1
nick fernandes is an unknown quantity at this point
Re: Digital Inputs

what kind of switch are you using, and how many positions is it?
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2009, 18:41
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Digital Inputs

We got it working with a single pole, double throw switch with the Signal wire connected to the center, and the Ground and +5V on the outsides. We'd like to use a push button. However, that only has two inputs. So what I was thinking was having the pushbutton connected to Signal and +5V (or signal and Ground) and having a resistor that connects the two inputs, so when the switch is not pressed, the input reads 0, instead of the on/off flip flop it usually does. Someone in another topic suggested using a resistor, but so far I have not been able to get this working.
Reply With Quote
  #5   Spotlight this post!  
Unread 24-01-2009, 22:07
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Digital Inputs

Your switch should probably be between Signal and Ground, with a 10k resistor between Signal and +5.

You can do it in the other direction, with the switch between Signal and +5 and the resistor between Signal and Ground, if you want.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2009, 00:35
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Digital Inputs

Ah. I guess that would make sense, wouldn't it?

Thanks. I'll try it out on Monday.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
reading multiple digital inputs angelkat Programming 2 25-01-2009 00:22
digital inputs: some bad? Trav-O Electrical 3 18-02-2008 23:29
Digital inputs in autonomous mode? Calvin Programming 8 18-02-2006 13:16
Digital inputs, bandwith, errors? Micah Brodsky Programming 7 20-01-2003 16:08
Analog vs Digital inputs? f22flyboy Programming 8 08-11-2002 22:18


All times are GMT -5. The time now is 17:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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