Ps2 v4 controller not pairing with receiver

Hi,
I have a Lynxmotion Ps2 v4 controller, and I am trying to pair it with my arduino. I am having trouble pairing it.
I downloaded and added the library, and can’t seem to get the two to pair … I keep getting not connected:
11:17:59.399 → No controller found, check wiring, see readme.txt to enable debug. visit www.billporter.info for troubleshooting tips
11:17:59.536 → Unknown Controller type
Is there a simple thing I am doing wrong with the actual controller? I’ve set the loop to keep trying to connect, in my code, below … I press [start] on the controller, it flashes green and red for a number of seconds … I have the correct wiring for the pins I have selected in my code … The receiver power light is solid red … but they fail to connect.
Is it a digital or analog thing?
What am I doing wrong? Iam lost …
Thanks in Advance!



#include <PS2X_lib.h>

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#define MIN_PULSE_WIDTH   650
#define MAX_PULSE_WIDTH   2350
#define FREQUENCY         50

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
int motorA=0;
int motorB=4;
int motorC=8;
int ps2_DAT=10;
int ps2_CMD=11;
int ps2_ATT=12;
int ps2_CLK=13;

PS2X ps2x; // create PS2 Controller Class
//right now, the library does NOT support hot pluggable controllers, meaning 
//you must always either restart your Arduino after you conect the controller, 
//or call config_gamepad(pins) again after connecting the controller.
int error = 0; 
byte type = 0;
byte vibrate = 0;


void setup() {
  Serial.begin(9600);
  Serial.println("begin");
  
  //pwm.begin();
  //pwm.setPWMFreq(FREQUENCY);
  //test();
  
  addController();
}

void loop() {
  if (error != 0)
  {
    addController();
    
  }
  checkControllerInput();
}

Hi DirkL3,

The first thing to do would be to use the Lynxmotion PS2X library found HERE.
Make sure to delete the one you have first.

Use the following pins to connect the receiver:

Open the example in the library PS2X_Example and try it
Do not mix other code at this point, just run the example and open your Serial Monitor to verify the Wiring and Code is working.

This thing is Digital in the communication side.

All the best,

1 Like

I tried just using the example;
When I power up the thing, it just shows the RED LED on the Receiver. … no flashing green, or anything.

the remote shows flashing green and red LEDs

Can you please attach some clear pictures of the wiring?

The LEDs have nothing to do with the communication between the receiver and the Arduino.

1 Like

“The LEDs have nothing to do with the communication between the receiver and the Arduino.”
right … they indicate between the receiver an the transmitter, right? that’s why I am wondering if there’s a procedure for pairing the two, that I am not following?

or if the solid red LED indicates the receiver is hosed?

Hi DirkL3,

To properly do the test, please insure that nothing else is connected to your Arduino board.
Also connect it as we suggested as it’s not on the right pins on your picture.

Regards,

1 Like

Hi, so I switched to a different controller/receiver combo, and they seem to pair: the lights are green on both. When the Arduino looks for controller input (x, triangle, circle, square, etc), it gets nothing, now, which makes me think that these brand new amazon batteries aren’t cutting it …
So it seems my original controller/receiver were fried. And I have them in the pins from the example sketch (9,7,6,8), and it makes no difference in reading the controller input …

Hi DirkL3,

I don’t think I understood everything.

The pinout should be the one I supplied earlier in THIS post. If you are using the right Example & Library (the one from Lynxmotion GitHub).

You might want to try directly to your Arduino as I don’t know if the pins are directly connected without any electronics in your shield.

All the best,