View Single Post
  #2   Spotlight this post!  
Unread 02-02-2002, 11:30
jnossen jnossen is offline
Registered User
#0613
 
Join Date: Feb 2002
Location: New Jersey
Posts: 6
jnossen is an unknown quantity at this point
'Place this in the main loop
gosub Comp_Switch:


'Place this below the main loop
Comp_Switch:

if rc_sw2 = 0 then low_pres: 'Compressor switch
comp_on = 0 'counter variable
relay1_fwd=1
relay1_rev=0
return



low_pres:
if(comp_on = comp_off) then compress_off: 'comp_off is set
'to 120. try other
'values to see which you like.
'Still not sure whcih value we'll use
relay1_fwd=1
relay1_rev=0
comp_on = comp_on + 1
return

compress_off: 'Deactivate Compressor
relay1_fwd=0
relay1_rev=0
return


Hope it helps. This assumes that you are going into digital inputs 2 and 6.