//load servo library!
Servo myServo;
void setup(){
myServo.attach(2);
}
void loop(){
for (int i=0; i<180;i+=1){ //repeats commands inbetween braces 180 times
myServo.write(i);//angle is a variable now
delay(10);
}
myServo.write(0);//go back
delay(500);
}
No comments:
Post a Comment