Thread: xbox controller
View Single Post
  #3   Spotlight this post!  
Unread 06-02-2008, 14:09
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: xbox controller

I assume you mean that you want one of the thumbsticks to control each side of your robot.

Short version, the USB Dongle must be set to Mode 1 and have the xbox controller plugged in. The code will look similar to:
Code:
pwm1 = p1_x; //Right Side
pwm2 = p1_y; //Left Side
That is assuming that the dongle is put on port 1 and your drive motors are pwm1 and pwm2.

Take a look at the user guide for the USB Dongle here Page 5 should show you what the code will reference. Look at XBOX/XBOX 360 Mode 1. Or if you need to still use the x axis on the controllers look at Mode 2.

I hope this helps.

Last edited by Andrew Schreiber : 06-02-2008 at 14:11.