
#include <Servo.h> Servo myServo1 ; // create object Servo myServo2 ; void setup() { myServo1.attach(9) ; myServo2.attach(10) ; delay(1000) ; } void loop() { for (int j=0 ; j <=160 ; j++ ) { myServo1.write(j) ; // j is the angle myServo2.write(j) ; delay(50) ; } for (int m=160 ; m >=0 ; m-- ) { myServo1.write(m) ; // m is the angle myServo2.write(m) ; delay(50) ; } }