Go to Post Now I want to casually slip the word [B]Hemispherical Omnidirectional Gimbaled Drive[/B] into normal conversation .... - [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-31-2015, 12:16 PM
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Xbox Axis Help

Howdy folks, I need some help with my Xbox 360 remote. Currently I am using the Buttons to send signals to victor motor controllers and spike relays, but I would like to switch over to the left axis for my victors and right axis for my relays. Here is my current code. Any help would be greatly appreciated.

Code:
    boolean buttonPressedForwardSpike = false; // these are in init.
   
    boolean buttonPressedForwardVictor = false; // init

            if (xbox.getRawButton(3)) {  // tele
            	
            	spike1.set(Relay.Value.kForward);
            	spike2.set(Relay.Value.kForward);
            	buttonPressedForwardSpike = true;
            	
            	
            } else if (buttonPressedForwardSpike = true) {
            	
            	spike1.set(Relay.Value.kOff);
            	spike2.set(Relay.Value.kOff);
            	buttonPressedForwardSpike = false;
            }
            
            if (xbox.getRawButton(2)) {
            	
            	spike1.set(Relay.Value.kReverse);
            	spike2.set(Relay.Value.kReverse);
            	
            }
            
            
            if (xbox.getRawButton(1)) {
            	
            	victor1.set(.50);
            	victor2.set(.50);
            	buttonPressedForwardVictor = true;
            	
            } else if (buttonPressedForwardVictor = true) {
            	
            	victor1.set(0);
            	victor2.set(0);
            	buttonPressedForwardVictor = false;
            } 
            
            if (xbox.getRawButton(4)) {
            	
            	victor1.set(-.50);
            	victor2.set(-.50);
            }
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 08:13 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