We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
either running average or do interpolation/fade between present pos and target
The text was updated successfully, but these errors were encountered:
This is my version for a smoother servo movement:
/usr/local/lib/python3.4/dist-packages/picraftzero/providers/servo/piconzero.py
def set_angle(self, angle): msg = "Set Angle {}".format(angle) logger.debug(msg) if angle == self.last_angle or angle is None: return if self.last_angle is None: self.last_angle = 90 maxanglechange = 3 delta = angle - self.last_angle if abs(delta) > maxanglechange: logger.debug("Too fast change of angle. Throttling! angle {}, last {}".format(angle, self.last_angle)) if delta > 0: angle = self.last_angle + maxanglechange if delta < 0: angle = self.last_angle - maxanglechange self.last_angle = angle logger.debug(msg) pz.setOutput(self.servo_id, angle)
Sorry, something went wrong.
No branches or pull requests
either running average or do interpolation/fade between present pos and target
The text was updated successfully, but these errors were encountered: