SOLVED :4 Servos
Posted: 03 May 2019, 21:52
Hi!
My project needs 4 servos (4 parts to the bay so 4 blinds).
Anyway to achieve this on a single esp8266?
I've tried altering code to have 4 servo objects but I presume they must use too many timers as it all get confused. (with teh 4 objects i tried using one at a time and all at once - sames result)
myservo1.attach(4, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo2.attach(14, 700, 2100);
myservo2.write(event->Par3);
delayMillis(3000);
myservo2.detach();
myservo3.attach(12, 700, 2100);
myservo3.write(event->Par3);
delayMillis(3000);
myservo3.detach();
myservo4.attach(13, 700, 2100);
myservo4.write(event->Par3);
delayMillis(3000);
myservo4.detach();
but that just gets erratic.
Also tried using just one servo object but that just moves the first one.
myservo1.attach(4, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(14, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(12, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(12, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
Anyone achieved this?
My project needs 4 servos (4 parts to the bay so 4 blinds).
Anyway to achieve this on a single esp8266?
I've tried altering code to have 4 servo objects but I presume they must use too many timers as it all get confused. (with teh 4 objects i tried using one at a time and all at once - sames result)
myservo1.attach(4, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo2.attach(14, 700, 2100);
myservo2.write(event->Par3);
delayMillis(3000);
myservo2.detach();
myservo3.attach(12, 700, 2100);
myservo3.write(event->Par3);
delayMillis(3000);
myservo3.detach();
myservo4.attach(13, 700, 2100);
myservo4.write(event->Par3);
delayMillis(3000);
myservo4.detach();
but that just gets erratic.
Also tried using just one servo object but that just moves the first one.
myservo1.attach(4, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(14, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(12, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
myservo1.attach(12, 700, 2100);
myservo1.write(event->Par3);
delayMillis(3000);
myservo1.detach();
Anyone achieved this?