2

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

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

1 Answer 1

4

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.

4
  • Please explain. Can I use A1 To A6 to drive my servos Normally ??
    – Ranjan Jha
    Jul 30, 2015 at 4:03
  • Only PWM-capable pins can drive servos normally. Jul 30, 2015 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, 2015 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. Jul 30, 2015 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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