PS4 Controller, Arduino, and Odrive

Hi,

I am working on a project that uses a PS4 controller to control a vehicle with an arduino and an odrive. I know the odrive works and I know the ps4 controller code works but it seems that when I put them together there is an issue. The values from the ps4 controller are still received and printed out on the serial monitor but the motors dont move (im using the setvelocity command to control the motors).

I’ve gone line by line commeting out code to narrow it down and I beleieve the issue lies within the portion of the PS4 controller code pasted below. Maybe it has to do with the serial communication? I am also not fluent in programming as a disclaimer.

#if !defined(MIPSEL)
while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
if (Usb.Init() == -1) {
Serial.print(F("\r\nOSC did not start"));
while (1); // Halt
}
Serial.print(F("\r\nPS4 Bluetooth Library Started"));

Which Arduino? Is it one of the ones mentioned in that comment?

What is the Usb object? What library does it come from?

Is MIPSEL defined? I’m not familiar with that one. I guess it must not be because this code would have no effect if it was.

Where are you connecting to the ODrive?