Move servos at the same time

Hello, please how to make the servos do this at the same time?
At the moment servo 1 moves, then servo 2 moves. Thank you

for (pos = 90; pos <= 140; pos += 1) {
    servo1.write(pos);
    delay(40);
  }
  for (pos = 90; pos >= 40; pos -= 1) {
    servo2.write(pos);
    delay(40);
  }

As simple as that.
Mind you running two servos at once will probably require you to use an external power supply, as a USB connection can't supply enough power for two servos at once.

1 Like

Not exactly. Servos need to move differently. Try this.

for ( pos = 90; pos <= 140; pos += 1 )
{
  servo1.write ( pos );
  servo2.write ( map ( pos, 90, 140, 90, 40 ) );
  delay ( 40 );
}

Awesome. Thank you very much

Yes, I have external power supply. Thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.