View Single Post
  #5   Spotlight this post!  
Unread 23-01-2015, 16:35
AnnaliseD AnnaliseD is offline
Registered User
None #4284
 
Join Date: Jan 2015
Location: Cinncinnati, Ohio
Posts: 4
AnnaliseD is an unknown quantity at this point
Re: Driver Station Log Errors

After changing the input locations i still get this error

ERROR Unhandled exception: edu.wpi.first.wpilibj.util.AllocationException: PWM channel 5 is already allocated at [edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:126), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:145), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 33), edu.wpi.first.wpilibj.Jaguar.<init>(Jaguar.java:48 ), org.usfirst.frc.team4284.robot.Robot.teleopPeriodi c(Robot.java:68), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:150), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:234)]



heres the section of code it refers to


Jaguar leftArm = new Jaguar(1);
Jaguar rightArm = new Jaguar(2);
Jaguar retract = new Jaguar(3);

if (drivestick.getRawButton(4))
leftArm.set (-1);
rightArm.set (1);

try {
Thread.sleep(500); //stop for 1/2 second
} catch(InterruptedException ex) { // allows for interruption of the sleep period
Thread.currentThread().interrupt();
}
leftArm.set(0);
rightArm.set(0);

if (drivestick.getRawButton(5))
leftArm.set(1);
rightArm.set(-1);

try {
Thread.sleep(500);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
leftArm.set(0);
rightArm.set(0);


if(drivestick.getRawButton(8))
retract.set(1);
try {
Thread.sleep(1000); //1000 milliseconds is one second.
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
retract.set(0);

if(drivestick.getRawButton(9))
retract.set(-1);

try {
Thread.sleep(1000); //1000 milliseconds is one second.
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
retract.set(0);
Reply With Quote