How do I code a PS4 to control stepper motors arduino? (ps4 controls Robotic arm)

Hi I'm in an emergency I have a deadline for this project. I'm new at Arduino I basically have 4 stepper motors and 1 servo motor giving the arm 5 joints, allowing it to move in any direction. To create a claw device for the robot arm we are using a servo motor allowing it to grab any object. The stepper motors are going to be connected through a CNC shield Expansion Board as well as A4988 Driver to allow a smooth connection between the stepper motors and the Arduino chip. The A4988 drivers are going to be connected to a Driver Module DRV8825 which allows a connection between the CNC shield Expansion Board and the A4988.

Can anyone help me with how to code or have a code that can help me in having the PS4 controlling the stepper motors? Another words, PS4 being able to control the robotic arm. PLEASE HELP :frowning:

What is a PS4 and how does it work?

a PS4 controller. Im sorry I didnt specify :frowning:

That is no help to me. How does it work and what electrical connections will you have to your Arduino?

So basically its a controller that is used to play video games. But in this case I want to use it to control my robot arm I created. It has stick knobs and I need a code that connects with PS4. Like if the right analog stick knob of the controller moves right then the first step motor will move.

What Arduino connections will you make and will the PS4 require any power?

#include <Ps3Controller.h>

void event()
{
int yAxisValue =(Ps3.data.analog.stick.ly); //Left stick - y axis - forward/backward car movement
int xAxisValue =(Ps3.data.analog.stick.rx); //Right stick - x axis - left/right car movement

if (yAxisValue <= -50) //Move car Forward
{
}
else if (yAxisValue >= 50) //Move car Backward
{
}
else if (xAxisValue >= 50) //Move car Right
{
}
else if (xAxisValue <= -50) //Move car Left
{
}
else //Stop the car
{
}
}

void onConnect()
{
Serial.println("Connected!.");
}

void setup()
{

Serial.begin(115200);
Ps3.attach(event);
Ps3.attachOnConnect(onConnect);
Ps3.begin();
Serial.println("Ready.");
}

void loop()
{
}

you can use this example