user56415: I would like to use the Radiohead library and control a servo from the same Leonardo board.
Now the Radiohead library occupies timer1 and therefore cant be used together with the servo library. (It does offer to use timer2 which the Leonardo does not have.)
Are there any other Servo libraries that use timer3 or timer4 which the Leonardo has?
I have already tried:

https://github.com/nabontra/ServoTimer2  does not compile
https://www.pjrc.com/teensy/td_libs_TimerOne.html does not work (calling function blocks)


user56513: I wonder if you could use this PWM version of the Servo library written for the Arduino MEGA? Looking at the code, it looks like you would have to remove the "else if (pin == 44)" and "else if (pin == 45)" blocks of code in the attach() and detach() functions in Update Servo_Hardware_PWM.cpp. Just guessing here. I haven't tried it out.
https://github.com/dadul96/Arduino-Servo-Hardware-PWM-Library 

user47961: You could try manually sending the servo pulses with something like:
digitalWrite(SERVOPIN,HIGH);
delayMicroseconds(pulseWidth);
digitalWrite(SERVOPIN,LOW);

As long as the duration of the pulses is consistent, it doesn't matter if they don't occur regularly.
Downsides will be that there may be jitter if there are interrupts running, although there is the advantage that this will work on just about any pin.
If you are looking for a simple proof of concept, this may enough to test it out.

user37622: In file ServoTimers.hin standard Arduino Servo library change the timer
#elif defined(__AVR_ATmega32U4__)
#define _useTimer3
typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t;

on Windows the file ServoTimers.h is located in C:\Program Files (x86)\Arduino\libraries\Servo\src\avr

56415: <p>I would like to use the Radiohead library and control a servo from the same Leonardo board.</p>

<p>Now the Radiohead library occupies <code>timer1</code> and therefore cant be used together with the <code>servo</code> library. (It does offer to use <code>timer2</code> which the Leonardo does not have.)</p>

<p>Are there any other Servo libraries that use <code>timer3</code> or <code>timer4</code> which the Leonardo has?</p>

<p>I have already tried:</p>

<ul>
<li><a href="https://github.com/nabontra/ServoTimer2" rel="nofollow noreferrer">https://github.com/nabontra/ServoTimer2</a>  does not compile</li>
<li><a href="https://www.pjrc.com/teensy/td_libs_TimerOne.html" rel="nofollow noreferrer">https://www.pjrc.com/teensy/td_libs_TimerOne.html</a> does not work (calling function blocks)</li>
</ul>
 56513: <p>I wonder if you could use this PWM version of the Servo library written for the Arduino MEGA? Looking at the code, it looks like you would have to remove the "else if (pin == 44)" and "else if (pin == 45)" blocks of code in the attach() and detach() functions in Update Servo_Hardware_PWM.cpp. Just guessing here. I haven't tried it out.</p>

<p><a href="https://github.com/dadul96/Arduino-Servo-Hardware-PWM-Library" rel="nofollow noreferrer">https://github.com/dadul96/Arduino-Servo-Hardware-PWM-Library</a> </p>
 47961: <p>You could try manually sending the servo pulses with something like:</p>

<pre><code>digitalWrite(SERVOPIN,HIGH);
delayMicroseconds(pulseWidth);
digitalWrite(SERVOPIN,LOW);
</code></pre>

<p>As long as the duration of the pulses is consistent, it doesn't matter if they don't occur regularly.</p>

<p>Downsides will be that there may be jitter if there are interrupts running, although there is the advantage that this will work on just about any pin.</p>

<p>If you are looking for a simple proof of concept, this may enough to test it out.</p>
 37622: <p>In file <code>ServoTimers.h</code>in standard Arduino Servo library change the timer</p>

<pre><code>#elif defined(__AVR_ATmega32U4__)
#define _useTimer3
typedef enum { _timer3, _Nbr_16timers } timer16_Sequence_t;
</code></pre>

<p>on Windows the file <code>ServoTimers.h</code> is located in <code>C:\Program Files (x86)\Arduino\libraries\Servo\src\avr</code></p>
