Relay Error

Hello, I’m having some issues with Relays and I’m not entirely sure why. If anyone has any insight it would be much appreciated.

How I’m calling the pneumatics class:

Pneumatics pneu = new Pneumatics();

How I’m creating the relays:

Relay oneR = new Relay(2);
	   Relay twoR = new Relay(0);

There’s not nearly enough detail here to figure out your problem; bits of source code and wiring diagrams would be nice. The one thing that strikes me from what little is here is that you are linking the Relay and Pneumatics classes. Doing so was common up through 2014, when (spike) Relays were used to turn the compressor on/off, and could also (iirc) be used to control pneumatic solenoids. 3946 did not use pneumatics in 2015 (we have this as a fall project), so I’m not familiar with the details, but I believe that the normative pneumatics system in 2015 used the PCM (Pneumatics Control Module) to control the compressor through an entirely automated system that improved compressor startup efficency over a spike, and also used the PCM to control the solenoid valves. The bottom line is that a Relay and a Pneumatic system, while they could coexist on the same robot, were usually parts of different subsystems.

To go into more detail, we’re using three double solenoids to fill three air tanks with nitrogen gas. The two relays are used to fire the air in the tanks (3 barreled t-shirt cannon).

The strange things is if I put the relays into the class and use them from there I do not get an error. I’m not entirely sure why putting them into another class is causing issues.