Hi,
Below is simple program for servo motor to swing 0-90 digree in continuous form in loop. But I want to stop the servo motor after 10 cycles count.
Please share your comments if anyone knows.
#include<Servo.h>
Servo servo1;
int pos=0;
void setup() {
servo1.attach(9); // servo motor is connected to pin # 9
}
shailmanin:
Below is simple program for servo motor to swing 0-90 digree in continuous form in loop. But I want to stop the servo motor after 10 cycles count.
If you only want it to do a single group of 10 movements then @PaulS's answer is a simple solution.
If you want it to do 10 movements every time you press a button then you need a variable to count the movements, Set the variable to 0 when the button is pressed. Don't make any more movements when the count gets to 10.
Thanks for suggestion.
I am seeing couple of examples which point towards usage button or remote control connection to control the servo motor.
But I need to use break or stop to stop the servo motor after some time without using any other device.