|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Pressure switch
We are using a pressure switch to turn on/off the compressor. I've been searching the interent with no luck in finding anything useful. If you can help it would be appreciated.
|
|
#2
|
|||
|
|||
|
Re: Pressure switch
What exactly is the problem you are experiencing? You're extremely vague about what you're asking.
|
|
#3
|
||||
|
||||
|
Re: Pressure switch
I just want to learn how to program a pressure switch to turn on the compressor when the pressure gets lower than 90psi and turn off at 120.
|
|
#4
|
|||
|
|||
|
Re: Pressure switch
Run a periodic check on your Pressure Switch class to check if the value is less than 90 PSI, and if the compressor is not already on. If it isn't, turn it on. Then do another check to see if pressure is greater than 120 PSI, and if the compressor is on. If it is, turn it off.
|
|
#5
|
||||
|
||||
|
Re: Pressure switch
I just started learning java so I have no idea how to put that into code.
|
|
#6
|
||||
|
||||
|
Re: Pressure switch
There is a method in the WPLIB? for the compressor. It should run in one of the periodic sections of code. The pressure switch is one of the digital inputs which the method reads & turns on & off the spike on one of the digital outputs. I believe you pass the IO you are using. Sorry for vagueness, I have minions that do actual programing.
![]() |
|
#7
|
||||
|
||||
|
Re: Pressure switch
I still don't understand. Can you put that in actual code?
|
|
#8
|
|||
|
|||
|
Re: Pressure switch
Take a look at this web page. It shows how to use the Compressor object built into WPILib. It will automatically run the compressor when the pressure switch shows low pressure.
Be sure to not put the code in a loop since the Compressor class will start up a thread that will do all the checking in the background. http://wpilib.screenstepslive.com/s/...for-pneumatics Brad |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|