10% duty cycle @ 100hz

Hi all,

I saw lots of topics about servo's, pwm and all that.
I am just looking for a simple way to do this.

Right now i dont even have a idea what the lib sends out if you ask it to go to a position.
I heard that you get a pwm of 50hz somewhere, i need 100hz.

Setting a duty cycle i can not even find.

The most basic way for me would be this:

void loop() {
digitalWrite(13, HIGH);
delay(1);
digitalWrite(13, LOW);
delay(9);
}

This should give you a 100hz with 10% duty cycle.

Anyone know a better way?

TimerOne library is what you want.
You can set the frequency and DC to get what you need.

.

example:
https://github.com/PaulStoffregen/TimerOne/blob/master/examples/FanSpeed/FanSpeed.pde

The Servo library is fixed at standard servo rates, ie 50Hz. Someone somewhere will have
a hacked version that runs at 100Hz or more, for sure - google it. However note that the
Servo library can drive 12 pins per timer because its running at 50Hz - a 100Hz version would
necessarily support fewer pins per timer.

indeed:

servo.h

#define REFRESH_INTERVAL 20000 // minumim time to refresh servos in microseconds

And change the refresh interval - 20000us (20ms) is the standard 50Hz rate.

Now servo location = duty cycle?