Quote:
Originally Posted by anthonygraff24
In Hauppague High School's guide for coding a compressor, it asks for (in the constructor) int pressureSwitchSlot, int pressureSwitchChannel, int compressorRelaySlot, and int compressorRelayChannel. I assume the slots refer to the slots on the sidecar, but I don't know what the Channels refer to. Any help is greatly appreciated!
|
The slots actually refer to which slot the sidecar is plugged into on the cRIO. You should be able to get away with just using the 2 parameter constructor and putting in the relay channel and dio channel you plugged the switch and spike into on the sidecar, usually 1 and 1 for us.
Code:
Compressor compressor = new Compressor(1, 1);
The above code will work as long as your Digital Sidecar is plugged into the first Digital card on the cRIO. If you have a second digital card on the cRIO and are using that one you can use the below code to create your compressor.
Code:
Compressor compressor = new Compressor(2, 1, 2, 1);