|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Help with Errors
Hey, we are new to programming and when we run the code, we get this error.
Code:
ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.allocatePWMChannel(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.team3023.robot.DriveTrain.<init>(DriveTrain.java:10), org.usfirst.frc.team3023.robot.Robot.robotInit(Robot.java:122), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:72), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)] |
|
#2
|
|||
|
|||
|
Re: Help with Errors
Quote:
|
|
#3
|
||||
|
||||
|
Re: Help with Errors
For clarification, somewhere in your code you have
Code:
motor = Talon(0) //or a different number Code:
motor = Talon(0)//or a different number, but same number as before |
|
#4
|
|||
|
|||
|
Re: Help with Errors
I'm guessing you already fixed this problem with previous comments. An alternate to the PWM splitting in hardware is to map it in software. This can make life easier for your mechanical/electrical teams because they just plug each motor into a PWM slot and then you write the same value out multiple times in each software iteration:
Code:
init: motor1 = Talon(0); motor2 = Talon(1); loop: desiredMotor = 250; motor1.Set(desiredMotor); motor2.Set(desiredMotor); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|