Skip to content

Attach with Min Max bug #103

Open
@Teehee2

Description

@Teehee2

There seems to be an issue witihin the library for values of min and max in the attach(pin, min, max) function.
I am using an official Arduino Uno R3 and IDE version 1.8.19, Servo library version 1.1.8.
I am reading values back using the readMicrosecond function through Serial.

When using the overloaded attach function, min values above 1059 and max values below about 1900 do not work. Instead the library acts as no limits, my serial prints even reach up to 2800 microseconds. Please see details below:

Smallest microsecond range (works perfectly):

int min = 1059;
  int max = 1900;
  Servo2.write(0);
  Serial.println(Servo2.attach(servo2Pin, min, max));
  tftText("Servo 2");

'Unlimited' range after higher min:

int min = 1060
  int max = 1900;
  Servo2.write(0);
  Serial.println(Servo2.attach(servo2Pin, min, max));
  tftText("Servo 2");

'Unlimited' range after higher max:

int min = 1060
  int max = 1850;
  Servo2.write(0);
  Serial.println(Servo2.attach(servo2Pin, min, max));
  tftText("Servo 2");

Higher range reaches up to about 2865:
image

Edit 23:40 18/07/2022: Wrong value for max, fixed now.

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