コード例 #1
0
ファイル: Arm.cpp プロジェクト: Team2530/RobotCode2014
//Controls motion of arm
void Arm::OperateArm() {
    AutoArm();
    //Controlled by right analog stick
    if (xboxController->GetRawAxis(5) >= 0.2 || xboxController->GetRawAxis(5) <= -0.2) {  //Absolute value of controller stick
        RaiseArm(xboxController->GetRawAxis(5));
    }

    //Controlled by hat switch on top of joystick
    else if (joystick->GetRawAxis(6) > 0.0)
        RaiseArm(1);
    else if (joystick->GetRawAxis(6) < -0.0)
        LowerArm(1);
    else if (!automatic)
        StopArm();
}
コード例 #2
0
ファイル: Arm.cpp プロジェクト: Team2530/RobotCode2014
//Automatically lowers and raises the arm all the way to the top/bottom on the press of a button
void Arm::AutoArm() {

    if (xboxController->GetRawButton(1)) {
        RaiseArm(1);
        automatic = true;
    }
    else if (xboxController->GetRawButton(2)) {
        LowerArm(1);
        automatic = true;
    }
}
コード例 #3
0
ファイル: TipBridge.cpp プロジェクト: team3499/2012
// Optionally raises the arm to clear the bridge, then lowers it.
// TODO - Get minimum angle to clear bridge in neutral position
void TipBridge::Execute() {
  if (needsReset) {
    if (!moving) { RaiseArm(); }
    if (accelerometer->GetArmDegree() > 35.0) {
      needsReset = false;
      StopArm();
    }
  } else {
    LowerArm();
  }
}