I am working on an Arduino UNO Project and running out of digital pins.

Can I convert the six analog pins to digital I/O and use them to drive servos?

Please suggest me a method

  • Just putting it out there that it is a Uno, not a UNO. It is not an acronym. – Nick Gammon Jul 30 '15 at 21:13

A0 through A5 already have GPIO capability; treat them as you would any other non-PWM pin.

A6 and A7, found in similar boards that use a SMD package, do not have any GPIO capability whatsoever and can only be used for analog input.

  • Please explain. Can I use A1 To A6 to drive my servos Normally ?? – Ranjan Jha Jul 30 '15 at 4:03
  • Only PWM-capable pins can drive servos normally. – Ignacio Vazquez-Abrams Jul 30 '15 at 4:24
  • The servo library uses software pwm if I'm not mistaken. So you should be able to use any pin. – Gerben Jul 30 '15 at 7:49
  • 1
    @RanjanJha: A0 to A5 can be referred to as D14 to D20. You could use digitalWrite(A0) or digitalWrite(14) and the effect would be the same. – CharlieHanson Jul 30 '15 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.