Compressor Pressure Sensor

Is there a way to tell what the pressure is for an air compressor or on a valve from windriver C++. something like “m_compressor.GetAirPressure();” function.

No. Because there isn’t a sensor in the standard system that measures air pressure.
You could buy one, it’s called a pressure transducer, but they can be fairly expensive.

The best you can do is check if the pressure switch has been tripped to see if it thinks more pressure should be pumped or not.
Pretty much we can only trust it to indicate:

  • OFF = pressure has been at 120psi recently and it hasn’t yet dropped below 95psi
    *]ON = the pressure is not 120psi

To do that, you’ll need to install a sensor that can measure air pressure, and connect it to the robot control system so you can read its value. There was one in the 2004 Kit of Parts, made by Texas Instruments if I’m remembering correctly. It provided an analog voltage proportional to the pressure.

Is there a way to make one of those sensors because we didn’t have a team back in 2004?

“Make” a pressure sensor?

Technically, if some company can make one, so can you. I suppose.
But practically: No. You should buy one.
Something like this should do.

Well, maybe not that one exactly—it doesn’t have a barbed fitting for attaching a tube. (I’ve seen similar ones designed to accommodate tubing in that way, but I’m not sure if they’re sized for FRC-legal tubing.) The one in the old KOP was embedded in a brass NPT-threaded fitting, and avoided tubing altogether.

And definitely check the rules closely before using these in competition. They’re exposed to air pressure, so would almost certainly be considered a pneumatic part, and therefore be subject to stringent regulations.