USFirst.org
follow us on twitter
like us on facebookMNFTC.org
Bookmark and Share

Thanks

The team members of FRC Team 2220 would like to give a big thanks to all of the Sponsors, Mentors and Parents that make having this team possible.

Thank you!

Team Login



Control Board.cpp Create PDF Send to Printer Email this Article
Written by TarinB   
Saturday, February 13 2010 16:44

 

#include "ControlBoard.h"

 

ControlBoard::ControlBoard(void)

{

rightStick = new Joystick(1);

leftStick = new Joystick(2);

shootStick = new Joystick(3);

ds = DriverStation::GetInstance();

}

 

float ControlBoard::GetX(int whichStick)

{

float value = 0;

if (whichStick == ControlBoard::LEFT)

{

value = leftStick->GetX();

}

if (whichStick == ControlBoard::RIGHT)

{

value = rightStick->GetX();

}

if (whichStick == ControlBoard::SHOOTER)

{

value = shootStick->GetX();

}

return value;

}

 

float ControlBoard::GetY(int whichStick)

{

float value = 0;

if (whichStick == ControlBoard::LEFT)

{

value = leftStick->GetY();

}

if (whichStick == ControlBoard::RIGHT)

{

value = rightStick->GetY();

}

if (whichStick == ControlBoard::SHOOTER)

{

value = shootStick->GetY();

}

return value;

}

 

bool ControlBoard::GetRawButton(int whichStick, UINT32 button)

{

bool bPressed = false;

if (whichStick == ControlBoard::LEFT)

{

bPressed = leftStick->GetRawButton(button);

}

if (whichStick == ControlBoard::RIGHT)

{

bPressed = rightStick->GetRawButton(button);

}

if (whichStick == ControlBoard::SHOOTER)

{

bPressed = shootStick->GetRawButton(button);

}

return bPressed;

}

 

bool ControlBoard::GetDigitalIn(UINT32 channel)

{

bool bJumperOn = false;

bJumperOn = ds->GetDigitalIn(channel);

return bJumperOn;

}

 

 
Lockheed Martin
Valid XHTML 1.0 Transitional Valid CSS!
Blanda
Blanda
Copyright © 2012 Eagan Robotics. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.