Every time I change the value inside the variable 'angle' and run the code it moves to the same position. It's very weird but the most strange thing is that when few months ago I used an Arduino Mega with the same code it was working perfectly. I changed the pin and double-checked the skematic but no way. I tried also to use the "writeMicroseconds" function instead, but I got the same result. I really don't know which way to turn, so any suggestion wuold be very useful.
Thank you all for your help
the code on your screen in the video is not the code from post#7. The code you ran made the servo move to one position and stay there. The code you ran worked as you wrote.