Skip to content

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

Open
@arpita-agrawal

Description

@arpita-agrawal

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions