You can use Arduino Leonardo analog pins as digital pins, just like with other Arduino boards.

Since Arduino UNO is the most popular version of Arduino boards, most of the information you can find on this subject regards Arduino UNO. However the mapping between analog and digital pins in Leonardo is different:

Leonardo’s analog-digital pins mapping (A – Analog pin, D – Digital pin):

A0 = D18

A1 = D19

A2 = D20

A3 = D21

A4 = D22

A5 = D23

If you’re interested in the corresponding mapping for Arduino UNO board, click the following link:

http://www.instructables.com/id/How-to-add-6-extra-pins-to-your-Arduino-with-no-ex/

By horaz

Hello, my name is Horacio Conde, Vic’s proud father, an apprentice maker and a computer science engineer. I live in Mexico City and I’ve been working professionally in software development for more than fifteen years now. I’m very interested in technologies such as programming, The Internet of Things (IoT) (Arduino, Raspberry Pi), electronics, physical computing, automation, woodworking.

2 thoughts on “Arduino Leonardo Analog Pins as Digital Pins”
  1. Muy util a falta de un Arduino Mega, personalmente yo ocupe esos pines analogicos para un Display.

    1. Eso es exactamente lo que me pasó a mí también, Giova… como estaba conectando un display, tuve necesidad de más pines y bueno… BENDITA NECESIDAD!!!

      Gracias por el comment! Saludos!!!

Leave a Reply

Your email address will not be published. Required fields are marked *