View Single Post
  #18   Spotlight this post!  
Unread 01-11-2009, 05:13 PM
Shalmezad Shalmezad is offline
Registered User
FRC #2619
 
Join Date: Sep 2008
Location: Midland
Posts: 2
Shalmezad is an unknown quantity at this point
Cool Re: detecting your own alliance(C++)

Inside the WPI library, look in the driverstation.cpp file.
Inside there, you'll find that there is a function to tell you what alliance you are on (also, there is one that will tell you what station you're plugged into, 1,2, or 3)

Quote:
DriverStation::Alliance DriverStation::GetAlliance()
{
if (m_controlData->dsID_Alliance == 'R') return kRed;
if (m_controlData->dsID_Alliance == 'B') return kBlue;
wpi_assert(false);
return kInvalid;
}
Have fun
Reply With Quote