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?
SOLVED :4 Servos
Moderators: grovkillen, Stuntteam, TD-er
SOLVED :4 Servos
Last edited by cherowley on 05 May 2019, 14:22, edited 1 time in total.
Re: 4 Servos
Wiki says maximum is two servos using the servo command.
If you need to control four then I suggest using the UDP feature. Have the rules in a master ESPEasy control a slave ESPEasy. That will get you four servos.
- Thomas
If you need to control four then I suggest using the UDP feature. Have the rules in a master ESPEasy control a slave ESPEasy. That will get you four servos.
- Thomas
Re: 4 Servos
Cheers Thomas, suspected it was a hardware limitation with hardware timers or the like..
Thanks for the pointer
Thanks for the pointer
SOLVED: Re: 4 Servos
Just a follow up in case anyone else wants to use more than 2 servos - by defining more instances it does actually work fine, I'm now using 4 servos with espeasy with no problems.
The problem was the wiring. My servos power are connected together then linked to the psu with a single cable. This wire was of insufficient gauge, causing brownouts on the servos I suspect!
Oops and shame on me for not checking the basics!
The problem was the wiring. My servos power are connected together then linked to the psu with a single cable. This wire was of insufficient gauge, causing brownouts on the servos I suspect!
Oops and shame on me for not checking the basics!
Re: SOLVED :4 Servos
That's a pleasant surprise. Thanks for the update.I'm now using 4 servos with espeasy with no problems.
- Thomas
Who is online
Users browsing this forum: No registered users and 140 guests