We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
In other servo libraries calling write() or writeMicroseconds() before attach sets the initial position of the servo on attach.
write()
writeMicroseconds()
This causes the servo to not work in the latest staging release. See code to reproduce below.
#include <Servo.h> Servo servo; int servoPin = 13; void setup() { servo.writeMicroseconds(544); servo.attach(servoPin); delay(3000); } void loop() { int us; for (us = 544; us <= 2400; us += 2) { servo.writeMicroseconds(us); delay(3); } for (us = 2400; us >= 544; us -= 2) { servo.write(us); delay(3); } }
The text was updated successfully, but these errors were encountered:
Upon further investigation, the _minUs and _maxUs variables are only initialised in attach(). This means that the values are 0 when calling write().
_minUs
_maxUs
attach()
0
In write() the value will evaluate to 0.
value
value = map(value, 0, 180, _minUs, _maxUs);
In writeMicroseconds() the value will evaluate to 0 too.
value = max(_minUs, min(_maxUs, value));
Will create a pull request.
Sorry, something went wrong.
No branches or pull requests
In other servo libraries calling
write()
orwriteMicroseconds()
before attach sets the initial position of the servo on attach.This causes the servo to not work in the latest staging release. See code to reproduce below.
The text was updated successfully, but these errors were encountered: