title: Arduino servo without library
body: <p>As education exercise on sending digital signals, I'm trying to code the pulse train for a servo without using the servo.h library.</p>
  
  <p>The servo is a 9g micro servo. Hardware is correct, as many examples using servo.h work fine.</p>
  
  <p>I have the following code. The problem is that the servo jerks around for 3 seconds rather than moving and holding still.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>void loop() {
      movePulse_1000();
      delay(3000);
  }
  
  void movePulse_1000(){
      Serial.print("Start movePulse_1000()\t\t");
      for (int pulseCounter=0; pulseCounter&lt;=150; pulseCounter++){
          digitalWrite(pinServo,LOW);
          delay(20); // between pulses
          digitalWrite(pinServo,HIGH);
          delayMicroseconds(1000);
      }
      Serial.println("End movePulse_1000()");
  }
  </code></pre>