Thread: Compressor
View Single Post
  #3   Spotlight this post!  
Unread 25-01-2003, 20:45
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by Jferrante
What relay # are you using? Are you using one or two pressure switches? What port(s) are they connected to?

If you had the compressor hooked up to relay1 and the pressure switch to rc_sw1 you're code could be as simple as:

relay1_fwd = 1 - rc_sw1

Of course you would need to add in some sort of timer to keep your compressor from cycling once the system filled up.
You probably want to use relay1_fwd=rc_sw1 instead since the pressure switch is normally close (1) and only opens (0) when the pressure gets high enough. Also, due to the way this year's switch works (opens at 115, but doesn't close again until 95psi), you don't need any special code to avoid cycling.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php