How to get current pressure on pneumatics?

I’m trying to see if my PSI for my pneumatics is below something that way I can turn on the compressor, I see this method called getCurrent() but that is for the amperes, not the PSI.

If you are using the rev pneumatic hub with an analog pressure sensor, you can call getPressure(). Otherwise, you’ll have to plug an analog pressure sensor into one of the analog input pins on the roborio.

The compressor is only capable of running in a closed loop. This means that if you have a digital pressure sensor plugged into your PCM/PH, you only need to have a Solenoid or DoubleSolenoid object in your code to get your compressor to run. The compressor will turn on when the pressure switch is not triggered, and turn off when it is (around 120 PSI).

If you don’t need to intentionally turn the compressor off for some specific reason (power optimization or the like), you don’t need to write any code to interact with the compressor.

It isn’t directly possible to turn the compressor on, you can only turn it off or enable closed loop control (digital for PCM and digital/analog/hybrid for PH).

I’m late to the thread here, but teams may elect to disable the compressor - say toward the end of the match - if the pneumatic tank is full, or you don’t need pneumatics anymore. This saves battery power you may want for End Game, etc.

DriverStation class: getMatchTime()

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.