Hello, I have made code for my team's minibot deployment system. It worked once, then never again
Code:
package com.robototes.abomasnow;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Timer;
public class MinibotDeployment {
Jaguar armSwingyMotor;
LimitSwitch thePole;
MinibotDeployment(int vicPort, int swiPort) {
//the thing that sets crap up
this.armSwingyMotor = new Jaguar(4, vicPort);
this.thePole = new LimitSwitch(swiPort, 14);
}
void hitThePole(Driver robot) {
robot.stop();
double time = Timer.getFPGATimestamp();
while ((Timer.getFPGATimestamp() < time + 5.0f) && this.thePole.getLeftWays()) {
System.out.println(';');
this.armSwingyMotor.set(0.25);
}
this.armSwingyMotor.set(0);
}
void resetArm() {
}
}
Limitswitch:
Code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.robototes.abomasnow;
import edu.wpi.first.wpilibj.DigitalInput;
public class LimitSwitch {
DigitalInput one;
DigitalInput two;
LimitSwitch(int port, int otherPort) {
one = new DigitalInput(4, port);
two = new DigitalInput(4, otherPort);
}
boolean getLeftWays() {
return this.one.get();
}
boolean getRightWays() {
return this.two.get();
}
boolean[] get() {
boolean[] foo = {this.getLeftWays(), this.getRightWays()};
return foo;
}
}
resetArm is supposed to be blank.
Where did I screw up?