Controlling ESC with Arduino as the Transmitter

I am attempting to control a DC brushless motor using an ESC I purchased from Amazon. However, I am encountering difficulties with initializing the ESC. While the ESC emits a series of beeps, it does not respond to any input. Occasionally, I hear the melody typically played when the ESC is connected to my RC cars, but it quickly reverts to continuous beeping with no control over the DC motor.

Below is the code I am currently running, as well as the setup I am using. Any guidance or suggestions to resolve this issue would be greatly appreciated.

#include <Servo.h>

Servo esc;  // Create a Servo object to control the ESC

void setup() {
  Serial.begin(9600);  // Initialize serial communication at 9600 baud
  esc.attach(9);       // Attach the ESC to digital pin 9
  esc.writeMicroseconds(1000);  // Initialize the ESC with a 1000us signal
  delay(1000);  // Wait for the ESC to initialize
}

void loop() {
  if (Serial.available() > 0) {  // Check if data is available to read
    int speed = Serial.parseInt();  // Read the incoming integer
    if (speed >= 0 && speed <= 180) {  // Ensure the speed is within the valid range
      esc.write(speed);  // Set the ESC speed
      Serial.print("Speed set to: ");
      Serial.println(speed);
      delay(3000);
    } else {
      Serial.println("Invalid speed. Enter a value between 0 and 180.");
    }
  }
}

Your topic does not indicate a problem with IDE 2.x and hence has been moved to a more suitable location on the forum.

Make a hand drawn wiring diagram clearly labelled, then take a picture and post here.

Please post a link to its datasheet. Don't point to the seller page.

I have looked all over for a data sheet and the only thing i could find was the one below.

20180128195540KS_250321_090741.pdf (149.4 KB)

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