You are on page 1of 1

#include <Servo.

h>

Servo fateh;
int pos1 = 0;

void setup() {

fateh.attach(9);

}
void loop() {

for(pos1 = 0; pos1 < 180; pos1 += 5)


{

fateh.write(pos1);
delay(10);

}
for(pos1 = 180; pos1 >= 1; pos1 -= 5)
{

fateh.write(pos1);
delay(10);

}
}

You might also like