Servo motor not working

Hey Guys this is legit urgent .
even after sliding slider in blynk motor shows no movement. i also checked whether slider is giving input and it is giving since i checked in serial monitor. but the motor shows no movement.
details :
• Esp8266 with Servo motor
• Smartphone Android version 10
• Blynk server
• sketch code:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include<Servo.h>

Servo servo1;
Servo servo2;

char auth[] = "************"; //Blynk Authentication Code
char ssid[] ="******";  //WiFi SSID
char pass[] = "**********";  //WiFi Password

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

servo1.attach(D4); // NodeMCU D4 pin  
servo2.attach(D2); // NodeMCU D2 pin
   }
  
void loop()
{
  
  Blynk.run();
  
}
BLYNK_WRITE(V3)
{
  servo1.write(param.asInt());
  Serial.println(param.asInt());
  delay(1000);
}
BLYNK_WRITE(V4)
{  
  servo2.write(param.asInt());
}

@sai1 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:
```

Pete.

1 Like

What does your serial monitor show, from booting-up your NodeMCU through to you moving the slider in the app?
Please copy/paste the contents of the serial monitor and use t6riple backticks again, rather than posting screenshots.

Pete.

well i just used Serial.println(param.asInt()); for getting the values of slider

[1658] Connecting to blynk-cloud.com:80
[1912] Ready (ping: 100ms).
90
135
180

the numbers mentioned are the slider inputs

How are your servos connected?

Pete.

Signal pin to D4 and output virtual at V3.

That makes no sense.
Each servo has three wires. How are each of these three wires connected?

Pete.

i know all that , just tell me you know the solution or not.

Let me see if I can use my psychic powers to work-out how you’ve connected your servos. Hold on a moment while I get my crystal ball out…

No, my psychic powers seem weak today, so I can’t figure-out your wiring, or if that’s part of your problem.
Sorry, looks like you’ll have to work it out for yourself :slightly_frowning_face:

Pete.

1 Like