#include <Servo.h> // Include Servo library
/*
Task
- include the Servo.h library
- create a Servo object
- create two loops
one that turns the servo arm from 0-180
one that returns the arm form 180-0
- there should be a dealy of 15 milliseconds
- connect a servo motor to pin 3
*/
Servo myServo; // Create a servo object to control the servo
int servoPin = 3; // servo moter is connected to pin 3
void setup() {
myServo.attach(servoPin); // Attach the servo motor to pin 3
Serial.begin(9600);
} // end of void setup
void loop() {
for (int angle = 0; angle<=180; angle++ ){
myServo.write(angle);
delay(15);
} // end of for loop 0 - 180
for (int angle = 180; angle>=0; angle = angle - 1 ){
myServo.write(angle);
delay(15);
} // end of for loop for 180 - 0
} // end of void loop