Programmer here. My team wants to have an on board compressor on the robot this year that turns on when the pressure in the tanks in x and shuts off at y pressure. We can can figure out how to turn it off and on. But any help or insights as to how we can get it to turn off/on at certain pressures would be most appreciated.
As long as you have the pressure switch attached to the high side of your system, it will automatically turn itself off and on when it reaches 120 PSI. Make sure you have the switch wired between the signal and ground pins on Digital Input 1 (the default input for the code).
You’ll need to Open the compressor in Begin, then Start it, then Set its RefNum with a handy name such as “Compressor”. In Periodic Tasks there’s already a bit of code that runs the Compressor Control Loop; you just need to enable it and make sure the RefNum Get name matches what you gave it in Begin.
The Compressor functions are in the WPI Robotics Library >> Actuators >> Compressor function subpalette.