Hi! I am working on a project to make an auto clicker for my ipad, it consists of a continuous servo that spins one full rotation every 5 minutes when a switch is on, but right now the servo spins and I do not know why, can someone help?
#include <Servo.h>
Servo myservo;
const int buttonPin = 2;
const int spinTime = 3000;
int pos = 0;
int buttonState = 0;
void setup() {
myservo.attach(9);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
myservo.write(180);
delay(spinTime);
myservo.write(90);
delay(300000);
}
}