2
0
mirror of https://github.com/team2059/Zaphod synced 2025-01-07 22:14:14 -05:00

made code changes

This commit is contained in:
Austen Adler 2014-02-27 17:17:40 +00:00
parent 9e9ea1e6de
commit 6dbf8665a7

View File

@ -1,7 +1,7 @@
//Sonar code
#include "WPILib.h"
#include "SmartDashboard/SmartDashboard.h"
//#include "Command.h"
#include "Command.h"
#include <iostream>
#include <math.h>
#include <vector>
@ -128,8 +128,6 @@ public:
upLimit = 167;
}
}
void calcRobot(){
}
void shootRobot(float power=0, bool override=false) {
override=true;
//Needs a limit to help the driver aim
@ -324,15 +322,17 @@ public:
}
} else {
if(i<=initalDriveTime*200) {
//Drive initialDriveTime amount of time
driveRobot(1.0f,0.0f);
//setMotorValue(6, 1, 1);
} else if(i>shooterDelay&&i<shooterDelay+(shooterDuration*200)&&shooterMaxAngle>=potToDegrees(armPot.GetAverageVoltage())) {
driveRobot(0, 0);
shootRobot(1, true);
//Shooting
driveRobot(0.0f, 0.0f);
shootRobot(1.0f, true);
setMotorValue(6, 1, 1);
}
if(i>480&&i<430+initalDriveTime){
driveRobot(-1,0);
driveRobot(-1.0f,0.0f);
setMotorValue(6, 1, 0);
//TODO
} else if(i>430+initalDriveTime/*&&ballLimit.Get()==1*/) {
driveRobot(-0.6f,0.0f);
@ -340,6 +340,7 @@ public:
//TODO
} else if(/*ballLimit.Get()==1&&*/i>430+initalDriveTime) {
driveRobot(1.0f,0.0f);
setMotorValue(6, 1, 0);
}
if(i>480&&i<480){
shootRobot(0.25f,true);