View Single Post
  #4   Spotlight this post!  
Unread 21-02-2004, 22:14
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Re: Pressure switch code

if your not a fan of bulky code:

relay8_fwd = !rc_dig_in18;
relay8_rev = 0;

from there, the RC has a built in pull up on the (s) line. soo you connect the white to one side of the switch and the black to the otherside of the switch. that is, if your using a pwm style color coded cable. you dont need the positive at all. the pressure switch is N.C. meening that with this setup the normal signal will be 0 and when it closes it will be 1. therefore !rc_dig_in18 yeilds 1 when it is normal and 0 when it goes over. no if statment needed.
__________________
--------------------------
"You're not a real programmer until all your sentences end with semicolons;"

Last edited by jacob_dilles : 21-02-2004 at 22:16. Reason: elaboration...
Reply With Quote