Xbox 360 Rapid Fire Controller

I have been trying to figure out how to make my controller shoot rapid fire in Call of Duty but it doesn't seem to work with the scripts I found.


This is my controller. Those three solid core wires are soldered each to three pins inside the controller. It doesn't show in the pictures but the first wire goes into the ground pin and the black one goes into 2 pin. In the tutorial I saw, the guy had a little button that he soldered to activate the rapid fire.

I am using two scripts I have found but none of them seem to make me shoot rapid fire.

Here are the scripts:

int val = 0; // stores values of the digitalread of the button
int button = 4; // positive leg of buttton connected fromm 3.3v to pin 4
int shoot = 2; // positive wire comming form the trigger/button on xbox controller

void setup() { // setting pinmode and starting serial connection
Serial.begin (9600);
pinMode ( button, INPUT);
pinMode (shoot,OUTPUT);
}
void loop() {
val = digitalRead (button); // reading button storing value
Serial.println (val); // just checking make sure button works
if (val == HIGH) { // if button is pressed
digitalWrite (shoot,HIGH); // needs to go high then low inorder
digitalWrite (shoot,LOW);// to fool conntroller
}
val = LOW; // resting val
}

and the other is

int button = 4; //The pin to connect one leg of the button (the other goes to ground)
int val1 = 0; //variable used to read the button
int shoot = 2; //The pin to econnect to the "middle" pin of the trigger pot on the controller
int led=13; //onboard arduino led pin
 
 
void setup() {
 //setup the pins for in/out
  pinMode (button,INPUT);
  pinMode (shoot,OUTPUT);
   pinMode(led, OUTPUT);  
  Serial.begin (9600);
}
 
void loop() {
  digitalWrite(shoot,HIGH); //set the trigger to high as default (this is off)
  val1 = digitalRead (button); //read the button
   
if ( val1 == HIGH ) { //iff the button is pressed
  digitalWrite ( shoot,LOW); //set the trigger to low (this is on)
  delay(50); //wait 50 milliseconds
  digitalWrite (shoot,HIGH); //set the trigger to back to high (this is of)
  delay(35); //wait 35 milliseconds
}
 
    if ( val1 == LOW ) delay (50); //not needed, I think I added this out of habbit to not consume 100% cpu lol... (this doesnt matter with arduino)
  digitalWrite(led,val1); //write the value of the button, to the led (so we can see whats going on)
 
}

Although I don't have rapid fire, there is still a connection that is being made because sometimes I start shooting without even touching the controller.

I followed this tutorial http://www.instructables.com/id/Mod-Xbox-360-Controller-Using-Arduino-MW3/?ALLSTEPS

Any suggestions? Thank you.

Although I don't have rapid fire, there is still a connection that is being made because sometimes I start shooting without even touching the controller.

-Try changing the button input to PULLUP --> pinMode (button,INPUT_PULLUP);

digitalWrite(shoot,HIGH); //set the trigger to high as default (this is off)

-Seems odd that this would be "off". Have you tried commenting this line out?

Also try changing some of the delays to observe changes in game. I built one of these controllers myself a couple of years ago but used a 555 timer with a pot instead and found it to work fairly well. Was a blast to play the old COD games with.

-Laggy

Thank you very much. Ill give this all a try.