BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Servo only move 90 degrees

I made a circuit with the esp8266
I done all the setup
I uploaded the code also, you can see the code

#define BLYNK_PRINT Serial
#define USE_NODE_MCU_BOARD

#include "BlynkEdgent.h"
#include <Servo.h>

Servo servo1;
Servo servo2;

BLYNK_WRITE(V0)
{
  int s0 = param.asInt(); // parameter as int 
  if(s0 == HIGH)
  { digitalWrite(D8,HIGH);
    delay(10);
    }  
    if(s0 == LOW)
  { digitalWrite(D8,LOW);
    delay(10);
    } 
    
}
BLYNK_WRITE(V1) {

servo1.write(param.asInt());
delay(1000);
}
BLYNK_WRITE(V2) {

servo2.write(param.asInt());
delay(1000);
}

void setup()
{
  Serial.begin(115200);
  pinMode(D8,OUTPUT);
  digitalWrite(D8,LOW);
  servo1.attach(5);
  servo2.attach(4);
  BlynkEdgent.begin();
}

void loop() {

    BlynkEdgent.run();
}

AlI things are working good
but the main problem is when I move the app slider 0-180 degrees the servo moves only 0-90 degrees
can anyone help me with that!!
Thanks in advance.
Regards,
Abhijeet

@techboystoys 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.

done

Which virtual pin is your slider widget attached to?

How have you defined the min/max values for that datastream?

Why do you have delays here:

Pete.

I am using V1 and V2 virtual pins to control two sliders for two servos
The min value is 0 and the max is 180
I am adding delay for smooth motion of servos

Can I see a screenshot of your datastream setup?

Blynk doesn’t like blocking delays.

Pete.

Your max value is not showing, but try with Double instead of Integer.

Same problem with Double

What happens if you increase the MAX value?

Servo comes to initial position if I increase the max value

How are your slider widgets configured?

Pete.

So it goes beyond the 90° now?
Delete the delays and try again, if that won’t work try to write a fixed 180 value to V1 and see if that works.
Also try with slider setting “send on release”.

I got the solution
the main problem is in esp8266 servo.h library
So I changed MIN_PULSE_WIDTH 1000 to 500 and MAX_PULSE_WIDTH 2000 to 2500
Now my servo move freely
Thanks to PeteKnight and bazzio for your precious time
best,
Abhijeet