Quasics2019Code/HedyLamarr/src/main/cpp/Commands/ElevatorToPositionOne.cpp
// Called just before this Command runs the first time
Called just before this Command runs the first time
Called just before this Command runs the first time
void ElevatorToPositionOne::Initialize() {
  if (Robot::elevator->atPositionOne()) {
    Robot::elevator->stop();
    moving_down = false;
  } else if (Robot::elevator->atBottom()) {
    Robot::elevator->moveUp();
    moving_down = false;
  } else if (Robot::elevator->atPositionTwo()) {
    Robot::elevator->moveDown();
    moving_down = true;
  } else if (Robot::elevator->atTop()) {
    Robot::elevator->moveDown();
    moving_down = true;
  } else {
    Robot::elevator->moveDown();
    moving_down = true;
  }
}
void ElevatorToPositionOne :: Initialize ( ) { if ( Robot :: elevator -> atPositionOne ( ) ) { Robot :: elevator -> stop ( ) ; moving_down = false ; } else if ( Robot :: elevator -> atBottom ( ) ) { Robot :: elevator -> moveUp ( ) ; moving_down = false ; } else if ( Robot :: elevator -> atPositionTwo ( ) ) { Robot :: elevator -> moveDown ( ) ; moving_down = true ; } else if ( Robot :: elevator -> atTop ( ) ) { Robot :: elevator -> moveDown ( ) ; moving_down = true ; } else { Robot :: elevator -> moveDown ( ) ; moving_down = true ; } }
Called just before this Command runs the first time
Called just before this Command runs the first time
// Don't know where we are, so (for now) we'll assume that we're too high. // If we figure out something different later, we'll adjust.