Objective:
Learn how to control a servo motor using Arduino to create precise angular movements between 0 and 180 degrees.
Steps to Perform:
- Click "Start Simulation" to power up the Arduino circuit
- The servo motor will begin sweeping motion automatically
- Servo rotates from 0° to 180° in 1-degree increments
- After reaching 180°, it reverses and sweeps back to 0°
- Each movement has a 100ms delay for smooth motion
- The sweep cycle repeats continuously
Key Concepts:
- Servo Motor: Motor that can rotate to precise angles (0-180°)
- Servo Library: Arduino library for easy servo control with Servo.h
- Pin 9: Digital pin connected to servo control signal wire
- servo.attach(): Connects servo object to specified pin in setup()
- servo.write(angle): Positions servo to specified angle in degrees
- Sweep Motion: For loops create smooth back-and-forth movement
- Delay Control: 100ms delay between steps creates visible motion