I saw many many videos on pwn and servo motor coding but can't understand how exactly the servo motor code works in arduino. my main confusion is what is the exact purpose of delay in the below code. when we say servo.write(180); doesn't it mean go to 180 degrees? what is the use of the delay here? some milliseconds cause the servo to work properly or jitter or vibrate not move or incorrect rotations etc.
include
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 15ms for the servo to reach the position
}