JoelRummel
15-01-2016, 15:52
I am trying to run a VERY SIMPLE piece of Java.
Its only goal is to set a motor's speed to 0.5.
Yet I have difficulties with even this simple task:
package org.usfirst.frc.team4855.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Talon;
public class Robot extends IterativeRobot {
Talon talonMotor;
public void robotInit() {
talonMotor = new Talon(0);
}
public void teleopInit(){
talonMotor.set(0.5);
}
Not only does this not work but I get a whole bunch of crap in the driver station:
ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.allocatePWMChanne l(Native Method), edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:117), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:134), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:35), edu.wpi.first.wpilibj.Talon.<init>(Talon.java:51), org.usfirst.frc.team4855.robot.Robot.robotInit(Rob ot.java:31), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:241)]
WARNING: Robots don't quit!
Give it enough time and the robot will just reach an emergency stopped state without any apparent reason.
What in the world am I doing wrong
Its only goal is to set a motor's speed to 0.5.
Yet I have difficulties with even this simple task:
package org.usfirst.frc.team4855.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Talon;
public class Robot extends IterativeRobot {
Talon talonMotor;
public void robotInit() {
talonMotor = new Talon(0);
}
public void teleopInit(){
talonMotor.set(0.5);
}
Not only does this not work but I get a whole bunch of crap in the driver station:
ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.allocatePWMChanne l(Native Method), edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:117), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:134), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:35), edu.wpi.first.wpilibj.Talon.<init>(Talon.java:51), org.usfirst.frc.team4855.robot.Robot.robotInit(Rob ot.java:31), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:241)]
WARNING: Robots don't quit!
Give it enough time and the robot will just reach an emergency stopped state without any apparent reason.
What in the world am I doing wrong