# 4 step slider as an analog input

**URL:** <https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980>\
**Category:** General Electronics\
**Created:** [October 22, 2023, 3:30pm UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980 "2023-10-22T15:30:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dant3s](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dant3s](https://forum.arduino.cc/u/dant3s)\
**Post date:** [October 22, 2023, 3:30pm UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980/1 "2023-10-22T15:30:52Z")

</div>

Hey, I'm new here 👋  
I have an Arduino nano and I want to use 4 step slider switch (like this one: [https://m.media-amazon.com/images/I/61u-SMRTwFL._AC\_UF894,1000\_QL80_.jpg](https://m.media-amazon.com/images/I/61u-SMRTwFL._AC_UF894,1000_QL80_.jpg)) to control 4 modes of my project, I would have used digital inputs but I run out 😥  
The problem is that I am an amateur and don't even know what to google for 😅  
Is this a good way to do the thing I need? [https://www.ignorantofthings.com/2018/07/the-perfect-multi-button-input-resistor.html](https://www.ignorantofthings.com/2018/07/the-perfect-multi-button-input-resistor.html)

---

<div class="post-metadata">

**Author:** ![paulpaulson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulpaulson/32/363643_2.png) [@paulpaulson](https://forum.arduino.cc/u/paulpaulson)\
**Post date:** [October 22, 2023, 4:02pm UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980/2 "2023-10-22T16:02:48Z")

</div>

Hello

Welcome to the worldbest Arduino forum ever.

You might connect the buttons to the Arduino via digital port pins.

Take a view here to gain the knowledge:

[![](https://europe1.discourse-cdn.com/arduino/original/4X/7/e/0/7e0ee1e51f1df32e30893550c85f0dd33244fb0e.jpeg) ](https://europe1.discourse-cdn.com/arduino/original/4X/7/e/0/7e0ee1e51f1df32e30893550c85f0dd33244fb0e.jpeg)

Have a nice day and enjoy coding in C++.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [October 22, 2023, 4:29pm UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980/3 "2023-10-22T16:29:53Z")

</div>

Welcome. Your resistor ladder will work with one analog input. You can also use the analog inputs as digital inputs. This link will help explain how to do it. [https://www.youtube.com/watch?v=\_AAbGLBWk5s](https://www.youtube.com/watch?v=_AAbGLBWk5s)

---

<div class="post-metadata">

**Author:** ![johnerrington](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnerrington/32/340106_2.png) [@johnerrington](https://forum.arduino.cc/u/johnerrington)\
**Post date:** [October 23, 2023, 5:35am UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980/4 "2023-10-23T05:35:13Z")

</div>

To give more detailed advice we would need to know the configuration of the switch.  
In my experience slide switches are unreliable so I'd prefer to choose a rotary switch;  
however an even simpler alternative would be to use a potentiometer (even a slide pot) connected to an analog input.

---

<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:** [April 20, 2024, 5:35am UTC](https://forum.arduino.cc/t/4-step-slider-as-an-analog-input/1180980/5 "2024-04-20T05:35:43Z")

</div>

Closed on April 20, 2024, 5:35am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
