Brushless Motor controlling using ESC

Hello,
I am using NODEMCU, ESC -30A, 930kv outrunner bldc motor,
i just need to control the speed of my motor, but it doesn’t working in that way, the motor starts beeping with some interval continuously,
Here is my code,
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest

Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.

Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator:           http://examples.blynk.cc
Blynk community:            http://community.blynk.cc
Follow us:                  http://www.fb.com/blynkapp
                            http://twitter.com/blynk_app

Blynk library is licensed under MIT license
This example code is in public domain.


This example runs directly on ESP8266 chip.

Note: This requires ESP8266 support package:
GitHub - esp8266/Arduino: ESP8266 core for Arduino

Please be sure to select the right ESP8266 module
in the Tools → Board menu!

Change WiFi ssid, pass, and Blynk auth token to run :slight_smile:
Feel free to apply it to any other example. It’s simple!
*************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "edDzhlUNKOJ2_h6dkb_wC0-Rh7toX2t1";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "MyNetwork";
char pass[] = "password";

Servo ESC;

void setup()
{
  // Debug console
  Serial.begin(9600);
  ESC.attach(2,1000,2000);//Pin Number D4
  ESC.writeMicroseconds(1000);
  Blynk.begin(auth, ssid, pass);
}

BLYNK_WRITE(V2){
  int pinValue = param.asInt();
  pinValue = map(pinValue, 0, 1023, 0, 180);
  ESC.write(pinValue);
  ESC.writeMicroseconds(pinValue);
  Blynk.virtualWrite(V1, pinValue);
  Serial.print("V2 Slider Value is: ");
  Serial.println(pinValue);
}

void loop()
{
  Blynk.run();
}

//This is my code
//Please help me if anyone knows what is wrong?

@Phani please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code, so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these characters if you can’t find the correct character on your keyboard.

Pete.

1 Like

Thank you Sir, done what you said…