Hello, I am using the PS2X library on my Uno, and I was wondering, does anyone know how to turn on the rumble motors in the PS controller?
best place to look is the examples for Bill porters library
https://github.com/madsci1016/Arduino-PS2X/blob/master/PS2X_lib/Examples/PS2X_Example/PS2X_Example.pde.
ps2x.read_gamepad(false, vibrate); //read controller and set large motor to spin at 'vibrate' speed
vibrate = ps2x.Analog(PSAB_BLUE); //this will set the large motor vibrate speed based on
//how hard you press the blue (X) button
Hmm. I tried ps2x.read_gamepad(false, vibrate); and I think I know what it does. (x,y) I think X should be true/false for the small motor, and Y is 0-255 speed for the large motor. I tried this out, making sure to connect power, and it doesn't work. Is the library set up right? Has anyone else got the motors to work?
I have gotten them to work in the past just playing around.
Load the whole example sketch and press X on the controller. Do they work like that?
If the library doesn't sense the controller as being a dual shock then the call is useless since there would be no motors to vibrate.
In the example sketch it should tell you what type of controller it sees in the serial monitor.
I loaded the example sketch and pressed X, and it doesn't do anything. My controller doesn't have the pressure sensitive buttons, but it is a dual shock. I think it is a dual shock 1. The example sketch also says that it is the guitar hero controller. I set the type=1; to make it dualshock, and everything seems to work besides the motors.
Sony brand or aftermarket brand?
Might be something to do with the brand and the way the command are processed.
Library works with official Sony controllers and i have used it with the wired and wireless version of the Pelican brand controller as well and they seemed to work ok.
Any time i have had it work the sketch also found it as a dual shock on it's own......
It is a Sony wired dualshock 1 controller. You know, the ones that are grey and were used with the PS1.
I think this is how they go:
PS = Grey and no joysticks
PS1 = Grey with joysticks = Dualshock 1
PS2= Black with joysticks = Dualshock 2
PS3 = Black and wireless = Dualshock 3