
Description:
Servo motors are motors you can move to a specific position. Depending on the rotation you can move the motor up to 180 or 360 degrees. This project simply loops through moving the servo to different positions.
Parts:
- Arduino Uno
- SG 90 Servo (180 degree)
- Wires

Servo myservo;
void setup() {
myservo.attach(8);
}
void loop() {
myservo.write(0);
delay(1000);
myservo.write(30);
delay(1000);
myservo.write(60);
delay(1000);
myservo.write(120);
delay(1000);
myservo.write(180);
delay(1000);
}
Code language: JavaScript (javascript)