Hello, thank you Shredder but I did the same thing and it didn’t work. so I think maybe the usb can’t power the Arduino enough, is it Possible that if I power it with 9v battery will work???
The USB is fine for powering the Arduino board, but not the servo because it can’t provide enough current for both. You will need either a separate AC adaptor or a battery dedicated to powering the servo just as zoomkat suggested earlier.
A 9V battery is not a good idea for two reasons. First, and most importantly, servos aren’t just electrical motors they have integrated electronic controls that are built to tolerate a certain voltage level. Exceeding that voltage level by too much can damage the electronics. Second, 9V don’t have a lot of charge capacity, even when compared to other common sizes like AA and AAA. All the “Latin letter” sized alkaline batteries (AAA, AA, C, & D) are nominally 1.5 VDC so you can connect them serially to get higher voltages. In fact you should be able to find cases for 4 AAA or AA batteries wired this way fairly easily.
Because if didn’t thats mean that the Arduino have problem and need to be changed.
I truly doubt it’s a problem with your Arduino.