# Can I Use Analog Pins Like Digital Pins

**URL:** <https://forum.arduino.cc/t/can-i-use-analog-pins-like-digital-pins/424447>\
**Category:** General Guidance\
**Created:** [December 11, 2016, 6:58pm UTC](https://forum.arduino.cc/t/can-i-use-analog-pins-like-digital-pins/424447 "2016-12-11T18:58:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewStudent](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@NewStudent](https://forum.arduino.cc/u/NewStudent)\
**Post date:** [December 11, 2016, 6:58pm UTC](https://forum.arduino.cc/t/can-i-use-analog-pins-like-digital-pins/424447/1 "2016-12-11T18:58:10Z")

</div>

Hey guys i am currently working on a project and i need a lot digital pins but i need more than 14 pins of the arduino uno and i cant afford an arduino mega for now so here is the question can i use analog in pins as digital pins by writing the code

```cpp
digitalWrite(A0, HIGH);

```

thanks for the help

---

<div class="post-metadata">

**Author:** ![vnn3](https://avatars.discourse-cdn.com/v4/letter/v/bbce88/32.png) [@vnn3](https://forum.arduino.cc/u/vnn3)\
**Post date:** [December 12, 2016, 5:27am UTC](https://forum.arduino.cc/t/can-i-use-analog-pins-like-digital-pins/424447/2 "2016-12-12T05:27:37Z")

</div>

Absolutly, Yes. That was happened to me when I started doing with Arduion. They mark as digital and analog pins make me think that they are different and tried to expand digital pins for some projects. After that I learnt to control pin directly and just knew that they are the same. Every newbie should try it (control pin directly).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 6:03pm UTC](https://forum.arduino.cc/t/can-i-use-analog-pins-like-digital-pins/424447/3 "2021-05-05T18:03:27Z")

</div>

Closed on May 5, 2021, 6:03pm UTC


