|
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...
|