The code looks ok. You could try making the delays longer, but I suspect your issue is power related - batteries out of juice perhaps.
The battries are new. I'm powering servo trough 4 X1.5V AA battery box.
What happens is that: The arm rotates in anti-clockwise direction for some degree (I don't know what position is it) and makes BUZZZ noise.
NOTE: THE POSITIVE AND NEGATIVE terminals are connected to POSITIVE AND NEGATIVE terminal of battery.
ONLY YELLOW WIRE IS CONNECTED TO ARDUINO PWM PORT 9
- Checked the electrical connections
- Tested this code on other servo same happens
- Tried out various code nothing seems to work same motion happens as prescibed above
Please point out mistakes or mishaps that might have happened during this project.