Dualsense controller

Hi there! I’m trying to use Java WPILib to control the rumble and LED’s on a PS5 controller, but I’m not sure how to do it. Could you explain the steps I need to follow and provide any necessary code snippets? I’d really appreciate any help you can offer!

The class you want is PS4Controller (there is no PS5 one, but PS4 should work?), and the functions you want to look at are setOutput() and setRumble(). I don’t know if setOutput() will actually control the LEDs though; if it doesn’t there’s no way to do it.

PS4Controller controller = new PS4Controller(1);  // assuming 1 is assignment in DS

…
controller.setRumble(GenericHID.RumbleType.kLeft, 1.0);
controller.setOutput(1, true);
2 Likes

I already tried the setRumble() and it didn’t work, I was wandering if there is a different library or API that I can use for using the ps5 controller

1 Like

Do you know if that functionality of the PS5 controller works at all in Windows? The DS application uses the XInput APIs to talk to Xbox style controllers (and DirectInput for other types of joysticks). But fundamentally if setRumble doesn’t work you’re likely out of luck. I assume you are successfully getting the input side of the controller to come through?

1 Like

Are you doing this in simulation with the emulated DS, or the real DS? I don’t think the former will work with setOutput/setRumble.

there are some apps such as DualSenseX that have full control over the controller functions

1 Like

i havent tried setOutput() yet

It appears that DualSenseX uses a driver, which means it doesn’t use Xinput or DirectInput and those features wouldn’t be supported on the driver station.

I believe DualSenseX is one of those drivers that exposes emulated gamepads to other apps, and supports XInput.

I suppose one could get rumble functionality working that way.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.