diff --git a/Commands/Elevator/Raise.cpp b/Commands/Elevator/Raise.cpp index c606bfc..d9d142f 100644 --- a/Commands/Elevator/Raise.cpp +++ b/Commands/Elevator/Raise.cpp @@ -10,15 +10,16 @@ void Raise::Execute(){ DentRobot::elevator->Run(1.0); } bool Raise::IsFinished(){ - if(!DentRobot::elevator->GetElevatorMiddle()){ - DentRobot::elevator->stoppedAtSensor=true; - } - if ((DentRobot::elevator->stoppedAtSensor)){ - printf("Stopped at the middle sensor\n"); - DentRobot::elevator->stoppedAtSensor=false; - return true; - }else if (!DentRobot::elevator->GetElevatorTop()) { - printf("Stopping at the top sensor\n"); + //if(!DentRobot::elevator->GetElevatorMiddle()){ + // DentRobot::elevator->stoppedAtSensor=true; + //} + //if ((DentRobot::elevator->stoppedAtSensor)){ + // printf("Stopped at the middle sensor\n"); + // DentRobot::elevator->stoppedAtSensor=false; + // return true; + //}else if (!DentRobot::elevator->GetElevatorTop()) { + if (!DentRobot::elevator->GetElevatorTop()||IsTimedOut()){ + printf("Robot stopped raising. Sensor based? %d\n", !DentRobot::elevator->GetElevatorTop()); return true; }else{ return false; diff --git a/RobotMap.h b/RobotMap.h index 0279c47..90aca69 100644 --- a/RobotMap.h +++ b/RobotMap.h @@ -6,8 +6,8 @@ // Elevator #define ELEVATOR_CAN 1 #define ELEVATOR_BOTTOM_DIO 9 -#define ELEVATOR_MIDDLE_DIO 8 -#define ELEVATOR_TOP_DIO 7 +#define ELEVATOR_MIDDLE_DIO 7 +#define ELEVATOR_TOP_DIO 8 #define ELEVATOR_ENCODERA 4 #define ELEVATOR_ENCODERB 9 diff --git a/Subsystems/Collector.cpp b/Subsystems/Collector.cpp index f1e8a22..f585676 100644 --- a/Subsystems/Collector.cpp +++ b/Subsystems/Collector.cpp @@ -19,6 +19,6 @@ void Collector::MoveRollers(double a){ GetSonarDistance(); } float Collector::GetSonarDistance(){ - printf("Sonar Distance %f\n",sonarAnalog->GetAverageValue()); + printf("Sonar Distance %f\n",sonarAnalog->GetAverageVoltage()); } // vim: ts=2:sw=2:et