View Single Post
  #7   Spotlight this post!  
Unread 03-06-2012, 21:11
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Robot Template

Thanks you very much

Now i have one more question how do i set the speed of a motor with a joystick

This is what i have right now:

Code:
package bilal.robotics.code;

import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Joystick.ButtonType;


public class Shooter 
{
    Jaguar shooter = new Jaguar(5);
    
    Joystick controller = new Joystick(2);
    
    final int buttonA = 1;
    
       
    
    public Shooter()
    {
        
    }
    
    public void shoot(){
        if(controller.getRawButton(buttonA)) {
            shooter.set();
        }
    }
    
}
I want the shooter motor to run according to the value of axis Y on the joystick when button A is pressed
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote