Go to Post More teams will want to join, peers who are not on the team will understand the program better, television will become interested in FIRST again, sponsors will be easier to get, cancer will be cured, the Israelis and Palestineians will live in harmony, and we will have world peace. - Andy Baker [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 20-02-2013, 07:52
AmLameBro AmLameBro is offline
Registered User
FRC #4034
 
Join Date: Jan 2013
Location: Pelham. NH
Posts: 6
AmLameBro is just really niceAmLameBro is just really niceAmLameBro is just really niceAmLameBro is just really nice
About button-controlled speed controllers

I am trying to have the shooting wheel spin at full speed when I hit a button. It is controlled via a Jaguar, and in the method, I just use (name).set(1.0);.

When I actually hit the button, though, the wheel just twitches on for a second and then stops before repeating it. On the smart dashboard, the command for the firing subsystem still reads the ShooterOn command.

Does anyone know how to fix this?

In FiringJag subsystem:
Code:
Jaguar firingjag;
public FiringJag(){
     firingjag = new Jaguar (3); // It is in PWM port 3
     setSafetyEnabled(false);
}
public void initDefaultCommand(){
     setDefaultCommand(new ShooterStop());
}
public void StartShooter(){
     firingjag.set(1.0);
}
public void StopShooter(){
     firingjag.set(0);
}
Here's ShooterStart and ShooterStop commands:

Code:
execute(){
     firingjag.StartShooter();
}
Code:
execute(){
     firingjag.StopShooter();
}
And finally, in OI:

Code:
public OI(){
     new JoystickButton(stick1, 4).whenPressed(new ShooterOn());
     new JoystickButton(stick1, 5).whenPressed(new ShooterOff());
}
Thanks in advance to anyone who can tell me what's wrong.

Edit: I've also tried the .whileHeld(new ShooterOn()), but the result is still the same; there's only pulsing

Last edited by AmLameBro : 20-02-2013 at 07:55.
Reply With Quote
 


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 10:07.

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