Controlling the Servo motor using a Push Button at 0°, 45°, 90°, 135°, and 180°.
Components required:
- Arduino
- Servo Motor
- Push Button
- Jumper Wire
Connections:
| Servo Wire | Connect To (Arduino) |
|---|---|
| Red (VCC) | 5V |
| Brown/Black (GND) | GND |
| Orange/Yellow (Signal) | Pin 9 |
| Button Pin | Connect To (Arduino) |
|---|---|
| One leg | Pin 2 |
| Other leg | GND |
Note:
The button connects between Pin 2 and GND. Arduino will use its internal pull-up, so when the button is not pressed, the pin reads HIGH; when pressed, the pin reads LOW.