/*
*include the servo motor library
*Create an object for accessing the function in the library
*Doing the sweeps
*/
#include <Servo.h>
//creating the ervo object
Servo myServoObject;
int angle =0;
void setup() {
// put your setup code here, to run once:
myServoObject.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
//myServoObject.write(90);
//myServoObject.write(0);
for(angle=0; angle<=180; angle++){
myServoObject.write(angle);
delay(1000);
}
for(angle=180; angle>=0; angle--){
myServoObject.write(angle);
delay(1000);
}
}