View Single Post
  #2   Spotlight this post!  
Unread 07-03-2008, 21:52
ebarker's Avatar
ebarker ebarker is offline
Registered User
AKA: Ed Barker
FRC #1311 (Kell Robotics)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Kennesaw GA
Posts: 1,437
ebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond reputeebarker has a reputation beyond repute
Re: Using Analog Inputs as Digital (on the OI)

tie a 10K resistor from +5 to the analog input pin

connect a switch from ground to the same analog input pin

when the switch is closed you will have a 0

when the switch is open you will have full scale analog value (I don't remember if it is 8 or 10 bit or what)

write some code that interprets

half-scale or lower as a switch closed
else
switch open
__________________
Ed Barker