View Single Post
  #2   Spotlight this post!  
Unread 24-01-2014, 15:31
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Pneumatics Coding

Quote:
Originally Posted by anthonygraff24 View Post
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);

Last edited by notmattlythgoe : 24-01-2014 at 15:36.
Reply With Quote