Telling the drivers station your alliance

There is a function in the WPI library drivers station that tells you what alliance you are on. How does the drivers station know which alliance you are on. Is it a line on the competition port? We need to know this if we are to search for the opponents trailer with the camera. We can write the code that uses this information but we can’t test it unless we can tell our drivers station its alliance. (kRed or kbBue)

In the past the drivers station tells your OI what alliance you are on. However I would put a simple switch on your robot that you flip to set one alliance or the other. You will know as you are putting your robot down what alliance you are on. This will let you test code and such now, and if you find out the information is available to your code then its a simple change to take it back out.

There is the User1 dip switch on the cRIO and we have thought about using this to switch the alliance that we are on if we don’t get it from the competition port. In your code you can see what the state of this switch is and use it for your own use.

Here is the CompactRIO cRIO-FRC Operating Instructions and Specifications document from NI, a very useful document. Learn more about the User1 dip switch here: