Go to Post devote your life to FIRST. It will pay off. - suneel112 [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 01-15-2013, 01:37 PM
Bennett Bennett is offline
Registered User
FRC #2977 (Sir Lancer Bots)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Minnesota
Posts: 26
Bennett is an unknown quantity at this point
Relay/Spike Problems?

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?
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 07:52 AM.

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