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