Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect servo read values for Nano 33 BLE Sense with MBED 1.1.6 #65

Open
arpita-agrawal opened this issue Nov 3, 2020 · 0 comments
Open
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@arpita-agrawal
Copy link

arpita-agrawal commented Nov 3, 2020

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);
}
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants