Eagan, MN
Welcome to the Lockheed Martin / Thomson-Reuters & Eagan High School Team 2220 Website!

PostHeaderIcon Control Board.cpp

 

#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;

}