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
flashko
September 24, 2022, 10:13am
3
Grumpy_Mike:
As simple as that.
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
system
Closed
March 23, 2023, 12:17pm
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.