The read method of Servo returns incorrect values. If position 0 is written the read value is -1 and for 180 the returned value is ~ 177- 178.
The issue is not seen with SAM, SAMD, or AVR.
Please use the below sketch for reproducing the issue:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
Serial.begin(9600);
}
void loop() {
myservo.write(0);
int currPos = myservo.read();
Serial.println(currPos);
delay(150);
myservo.write(180);
currPos = myservo.read();
Serial.println(currPos);
delay(150);
}
The read method of Servo returns incorrect values. If position 0 is written the read value is -1 and for 180 the returned value is ~ 177- 178.
The issue is not seen with SAM, SAMD, or AVR.
Please use the below sketch for reproducing the issue: