ESP8266 nodeMCU servo.read() error

Hello,

Whenever i call servo.read() on the nodeMCU, i sometimes get a number 1 degree less than the stated angle. Ive tested this on the Arduino uno which does not have this problem.

is it a rounding problem?

//#include <ESP8266WiFi.h> 
#include <Servo.h>
int i;

void setup() {

  Servo s1;
  Serial.begin(9600);
  s1.attach(16);
  s1.write(85);
  i=s1.read();
  Serial.print("\nServo angle is: ");
  Serial.println(i); 
}

void loop() {
  
}

The serial Monitor displays:

Servo angle is: 84

Has anyone had this issue or got any ideas to fix this problem?

Thanks.

Has anyone had this issue or got any ideas to fix this problem?

Look at the Servo library. There are different libraries for different architectures. Look at how write() is implemented. Look at how read() is implemented.

For better accuracy, do not use write() and read(). Use writeMicroseconds() and readMicroseconds().

Oh right, ill use writeMicroseconds() and readMicroseconds().

Thanks for your help.