user57118: I'm trying to programme a servo motor to reach certain positions. I have a 360 degrees servo motor, so I can not use the Servo library and I can only control the speed. Therefore I want to regulate the time for the pulse. The setup is simple, 5 V, GND and pin 9 from the Arduino to the motor.
int servo1 = 9;

void setup{
    Serial.begin(9600);
    pinMode(servo1, OUTPUT);
}
void loop{
    digitalWrite(servo1, HIGH);
    delay(5000);
    Serial.println(digitalRead(servo1));
    digitalWrite(servo1, LOW);
    delay(5000);
    Serial.println(digitalRead(servo1));
}

Expected:
I expect the code to run the servo motor at full speed for 5 seconds.
Actual:
The motor runs at the first impulse and pauses for 10 seconds.
How can I improve the code to do what I expect?

user77816: Apply some impulse which you need your servo to work on

57118: <p>I'm trying to programme a servo motor to reach certain positions. I have a 360 degrees servo motor, so I can not use the Servo library and I can only control the speed. Therefore I want to regulate the time for the pulse. The setup is simple, 5 V, GND and pin 9 from the Arduino to the motor.</p>

<pre><code>int servo1 = 9;

void setup{
    Serial.begin(9600);
    pinMode(servo1, OUTPUT);
}
void loop{
    digitalWrite(servo1, HIGH);
    delay(5000);
    Serial.println(digitalRead(servo1));
    digitalWrite(servo1, LOW);
    delay(5000);
    Serial.println(digitalRead(servo1));
}
</code></pre>

<p>Expected:
I expect the code to run the servo motor at full speed for 5 seconds.</p>

<p>Actual:
The motor runs at the first impulse and pauses for 10 seconds.</p>

<p>How can I improve the code to do what I expect?</p>
 77816: <p>Apply some impulse which you need your servo to work on</p>
