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

add a servo.stop() function #127

Open
macMikey opened this issue May 3, 2024 · 0 comments
Open

add a servo.stop() function #127

macMikey opened this issue May 3, 2024 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@macMikey
Copy link

macMikey commented May 3, 2024

think of this as something akin to an e-stop.
i have run into a situation, with the crunchlabs iturret. at power on, the turret attempts to pitch home. unfortunately, the force of that move can cause the turret to "spike" the magazine (because we don't know the power-on position of the servo, and we can't read it, either).
there are two ways to solve that problem (using this library):

  1. implement feature request: Servo class: servo.write(int angle, float rotationspeed) #71
  2. add servo.stop(). this command would act like an e-stop, cutting the signal to the servo, regardless of the .write() it is currently executing.
    i suppose my code for homing the servo would then look something like this:
for ( int i = 0 , i < 5 , i++ ) {
   servo.write (90);
   delay (5);
   servo.stop();
   delay (10);
}
servo.write(90); // just to ensure that we finally make it to 90, if the previous five moves didn't do it

in this way, the move to 90 would be broken into five moves (depending on the starting position), reducing the change in angular momentum, and still not requiring us to know the position of the servo.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 3, 2024
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: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants