Electronic speed controller not working

Im using a PS4 controller with the game control plus library in processing with a DC motor wired to an electronic speed controller in pin 2 of my arduino. The DC motor runs on 12-16Vs so my battery is a 14.8V and connected to the ESC.

Now for some background: I had another DC motor with an ESC built in, so the motor had a power wire, a signal wire coming from the ESC and an on off switch. This set up worked great but the motor wasn’t powerful enough so I swapped it out, the hardware is essentially the same just bigger. The problem is I can only get it to work sometimes in Arduino IDE and not once so far in processing. Normally the right hat would spin the motor clockwise and the left hat would rotate the motor CCW.

ESC work like servos right? Thats at least how I have been controlling my other DC motors. My code is below so hopefully someone sees something that doesnt make sense. Also, I cant use serial for this, I have to be running standard firmata because I have multiple sensors and cant run an arduino sketch. Thanks!

Heres a real simple sketch that I wrote to try and control these motors:

import processing.serial.*;

import net.java.games.input.*;
import org.gamecontrolplus.*;
import org.gamecontrolplus.gui.*;

import cc.arduino.*;
import org.firmata.*;

ControlDevice PS4;
ControlIO control;

Arduino arduino;

float thumbRH1;
float thumbRH2;

public void setup() {

size(200, 200);

control = ControlIO.getInstance(this);
PS4 = control.getMatchedDevice("control");

if(PS4 == null) {
    println("No controller");
    System.exit(-1);
}

arduino = new Arduino(this, "COM4", 115200);

arduino.pinMode(2, Arduino.SERVO);
arduino.pinMode(3, Arduino.SERVO);
}

public void getUserInput() {
  
  thumbRH1 = map(PS4.getSlider("Forward").getValue(), -1, 1, 0, 100);
  thumbRH2 = map(PS4.getSlider("Forward").getValue(), -1, 1, 0, 100);
}

public void draw() {
   
  background(100, 100, 100);
  
  arduino.servoWrite(2, (int)thumbRH1);
  arduino.servoWrite(3, (int)thumbRH2);
}

Do you have a motor shield for your arduino?

I have one, I’ll try that out! My last set up with smaller motors didn’t need one however so I would be surprised if it worked. Is there anything special I may need to add to my code to connect to the motor shield? I really want to avoid using Serial, would I need to alter the standard firmata protocol? Thanks!

I should also mention that in my larger project, I want a servo motor to be connected to the signal wire of each DC Motor, each pair will be controlled in parallel. Once again this system worked great without these bigger DC motors. Right now when I plug the servos into the signal wire coming off the ESC of my new motor it works with my PS4 controller with no problem.

I just recently ran the sketch with my voltmeter sitting in the VCC and ground of the ESC and sure enough no power is coming through to my DC motor. I tested the leads on my battery and I’m getting ~15V so that’s good. I checked the signal wire on my ESC and that has 5.5V so that’s good as well. I’m not sure if I’m wiring it incorrectly or if there is a problem with my sketch. I fully expected it to work when I ran my sketch. Thanks again for your help.

Below is the one that I use. Software libraries are provided by the company that sells the shield (Adafruit). The libraries are importable to the Arduino IDE so they are easy to install.