analogWrite on pin 9 or 10 stops working with a servo
- Arduino Uno
- Servo
Why it happens
- On most boards the Servo library switches off PWM on pins 9 and 10, even if the servo is elsewhere.
How to fix it
- Move the LED or motor speed wire to pin 3, 5, 6 or 11.
- Change the pin in the code.
It worked if: The LED fades again.
Related errors
Tutorials where it can happen
- Automatic Pet Feeder with Arduino and Servo
- Bluetooth Controlled Servo Motor using Arduino for Kids
- Color Detection and Sorting System with TCS34725
- Object Tracking and Following System with LCD Feedback
- Smart Blinds Control Based on Weather Conditions with LCD Feedback
- Smart Mailbox with Arduino, Ultrasonic Sensor and Servo
From the official documentation. From the Arduino Servo library page. Sources: Arduino Servo library.
Didn't help? Search another error or ask us.

