I have some code to turn on a spike that is connected to a compressor, and I can turn it on but not off, so I made a second button running a command to turn it off. Problem is, when I added the second command, nothing happens. If I comment it out, It works fine.
Code:
public class OI {
Joystick Joystick = new Joystick(1); //Xbox 360 Controller.
Button button1 = new JoystickButton(Joystick,1);
// Button button2 = new JoystickButton(Joystick,4);
public OI(){
button1.whenPressed(new SpikeOn()); //Runs command to turn it on.
// button2.whenPressed(new SpikeOff()); //Runs command to turn it off.
}
^^ Works Fine
Code:
public class OI {
Joystick Joystick = new Joystick(1); //Xbox 360 Controller.
Button button1 = new JoystickButton(Joystick,1);
Button button2 = new JoystickButton(Joystick,4);
public OI(){
button1.whenPressed(new SpikeOn()); //Runs command to turn it on.
button2.whenPressed(new SpikeOff()); //Runs command to turn it off.
}
^^ It won't do anything
Any Ideas?