On an Uno, tone() uses Timer 2 and Servo uses Timer 1. That removes PWM on some pins while they are in use.
What the message means
The board has only a few timers. Libraries claim them, and pins tied to that timer lose analogWrite.
Fix it in this order
- Check which pins share the timer that your library uses, in the board documentation.
- With the Servo library on an Uno, analogWrite on pins 9 and 10 stops working.
- With tone() on an Uno, PWM on pins 3 and 11 is affected.
- Move your PWM output to a pin on a different timer.
- Use a board with more timers, or a servo driver board, if you need many.
- Stop the tone before you use the affected pin.
Why it happens
The ATmega328P on an Uno has three hardware timers, and each one drives specific PWM pins. The tone function uses Timer 2, which also drives PWM on pins 3 and 11. The Servo library uses Timer 1, which drives pins 9 and 10, so analogWrite on those two pins stops working while Servo is in use. The ATmega328P datasheet maps each PWM pin to its timer.
Other boards have a different mapping. On a Mega, the Servo library takes different timers, so check the board documentation before moving a PWM output.
If you see this, do this
| You see | Do this |
|---|---|
| PWM stops after adding Servo | Timer 1 conflict. |
| PWM odd while a tone plays | Timer 2 conflict. |
Related
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.