> For the complete documentation index, see [llms.txt](https://monasheng.gitbook.io/zerotohero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://monasheng.gitbook.io/zerotohero/arduino-zero-to-hero/core-skills/input-output-pins/analog-pins.md).

# Analog Pins

{% embed url="<https://www.youtube.com/watch?v=vOFSZaD6zek>" %}

{% hint style="info" %}
:man\_mage: **Important:** In this context, the word ***analog*** essentially means *non-binary*.&#x20;

In contrast to [Digital Pins](/zerotohero/arduino-zero-to-hero/core-skills/input-output-pins/digital-pins.md), MCU analog pins are capable of either reading or writing voltages *between* `HIGH` and `LOW`, and can thus be used to detect/author a spectrum of states, or read from sensor inputs.
{% endhint %}

## Hardware

{% hint style="danger" %}
:zap: **Warning:** Unlike digital pins, analog pins are *either* capable of input or output, not both.&#x20;

You must carefully select an appropriate input/output pin for your application, or you will encounter *weird* behaviour and errors.
{% endhint %}

This module utilises an [Arduino Mega](https://store.arduino.cc/products/arduino-mega-2560-rev3), which provides:

* 12 analog *output-only* pins (labelled `D2-D13`) on the long-edge of the board with the button,
* 2 analog *output-only* pins (labelled `D44,D46`) on the short-edge of the board without the USB connector, and,
* 16 analog *input-only* pins (`A0-A15`) via the multi-purpose analog pins on the long-edge of the board without the button.

<figure><img src="/files/5yOSVWs7UkD1s00uDH5l" alt=""><figcaption><p>Arduino analog pins. Remixed from <a href="https://content.arduino.cc/assets/Pinout-Mega2560rev3_latest.pdf">https://content.arduino.cc/assets/Pinout-Mega2560rev3_latest.pdf</a> (CC-BY-SA).</p></figcaption></figure>
