Go to Post We don't require innovation; we simply encourage it. - Tristan Lall [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-04-2014, 13:31
Team1605 Team1605 is offline
Registered User
FRC #1605
 
Join Date: Feb 2012
Location: toronto
Posts: 30
Team1605 is an unknown quantity at this point
problem deploying code

I am suddenly getting an error when i deploy my code. my code is:
Code:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.Joystick; 
import edu.wpi.first.wpilibj.RobotDrive; 
import edu.wpi.first.wpilibj.SimpleRobot; 
import edu.wpi.first.wpilibj.Timer; 



public class Team1605 extends SimpleRobot {
    
    
    Joystick stickDriverLeft = new Joystick(1);
    Joystick stickDriverRight = new Joystick(2);
    
    
    Jaguar leftMotor = new Jaguar(2);
    Jaguar rightMotor = new Jaguar(1);
    Jaguar shooter1 = new Jaguar(3);
    Jaguar shooter2 = new Jaguar(3);
   
    
    RobotDrive robotDrive = new RobotDrive(leftMotor,rightMotor);
    
   
    
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {
        robotDrive.setSafetyEnabled(false);
        robotDrive.drive(-0.5, 0.0);//drive at 35% speed 0% turn
        Timer.delay(3.0);//wait 1 second
        robotDrive.drive(0.0, 0.0);//stop
        Timer.delay(1.0);//wait 1 second
        shooter1.set(1.5);
        shooter2.set(1.5);//5% spped shoots
        Timer.delay(1.0);//wait one second
        shooter1.set(0.0);
        shooter2.set(0.0);//stop shooter
        Timer.delay(5.5);// wait 7 seconds

       
        
        
        
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
      while(isOperatorControl() && isEnabled())
    {
        
    
     robotDrive.tankDrive(stickDriverLeft.getAxis(Joystick.AxisType.kY), stickDriverRight.getAxis(Joystick.AxisType.kY));
    
        
       
        if(stickDriverLeft.getButton(Joystick.ButtonType.kTrigger)) {
           shooter1.set(1.5);
           shooter2.set(1.5);
        }
        else if(stickDriverRight.getButton(Joystick.ButtonType.kTrigger)) {
            shooter1.set(-1.0);
            shooter2.set(-1.0);
        }
        else {
            shooter1.set(0.0);
            shooter2.set(0.0);
        }
        
      
               
        
        Timer.delay(.01);
    }

    }
}
the error i get is ...

Squawk VM] Version: 2011 FRC, Nov 5 2011, 14:34:13
[cRIO] FPGA Hardware GUID: 0x1394f6dc1feb42ec6910e5767ed1d22c
[cRIO] FPGA Software GUID: 0xa14c11bde4bb64aef6a86fc52a294cd9
[cRIO] Uncaught exception in Thread.run():
[cRIO] on thread edu.wpi.first.wpilibj.templates.Team1605 - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 3 on module 1 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:114)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:144)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 33)
[cRIO] at edu.wpi.first.wpilibj.Jaguar.<init>(Jaguar.java:46 )
[cRIO] at edu.wpi.first.wpilibj.templates.Team1605.<init>(Te am1605.java:36)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
[cRIO] Uncaught exception in Thread.run():
[cRIO] on thread edu.wpi.first.wpilibj.templates.Team1605 - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 3 on module 1 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:114)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:144)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 33)
[cRIO] at edu.wpi.first.wpilibj.Jaguar.<init>(Jaguar.java:46 )
[cRIO] at edu.wpi.first.wpilibj.templates.Team1605.<init>(Te am1605.java:36)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
Reply With Quote
  #2   Spotlight this post!  
Unread 08-04-2014, 13:34
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: problem deploying code

Code:
    Jaguar shooter1 = new Jaguar(3);
    Jaguar shooter2 = new Jaguar(3);
You are using the PWM 3 twice.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:32.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi