Hi all
Please could someone advise me why the following servo.sequencePlay code only works the once.
The first time the doorSwitch goes HIGH the code works, thereafter the servo.sequencePlay code is ignored .
I have spent some time on the internet but surprisingly i have found very little info.
much appreciated.
#include <VarSpeedServo.h>
//VarSpeedServo Servo1;
VarSpeedServo Servo2;
VarSpeedServo Servo3;
int doorSwitch = 8;
servoSequencePoint door[] = {{140, 3}, {120, 6}, {100, 9}, {80, 12}, {65, 15}, {50, 20}
};
servoSequencePoint gate[] = {{120, 10}, {75, 10}, {120, 10}, {75, 10}
};
void setup() {
Serial.begin(9600);
//Servo1.attach(10);
Servo2.attach(11);
Servo3.attach(12);
pinMode (8, INPUT_PULLUP);
//Servo1.write (53, 10);
Servo2.write (164, 10);
Servo3.write (53, 10);
}
void loop() {
if (digitalRead (doorSwitch) == HIGH) {
Servo2.sequencePlay(door, 6, false, 0);
Servo3.sequencePlay(gate, 4, false, 0);
}
if (digitalRead (doorSwitch) == LOW) {
Servo2.write (164, 10);
Servo3.write (53, 10);
}
}