How to setup a Rotary Switch with 1 Input
If you want to connect a rotary switch up without using all your digital pins, this is the video for you.
In this video I'm going to explain how you can use 1 analog pin on an Arduino to connect up to any pin amount rotary switch.
This is an alternative method to connecting up the pins of the rotary switch to your digital input pins, As it requires you to connect up each pin to a digital input and can take up a large portion of available pins on your Arduino.
This method can be used on most microcontrollers such as Arduino, RaspberryPi, ESP32, ESP8266 ect. as long as an analog pin in available.
If you are after the code I was using:
https://github.com/5cottyD/Projects/tree/master/Rotary%20Switch%20Analog%20Code
⏱️⏱️VIDEO CHAPTERS⏱️⏱️
------------------------------------------------
0:00 Intro
0:07 Digital pin method Wiring diagram
1:30 Analog pin method Wiring diagram
3:06 Resistor value selection
4:17 Breadboard Example
7:18 Arduino analogRead input range from 0 to 1023
8:07 Rotary switch setup / wiring / soldering
9:45 Wiring diagram vs Rotary switch setup
10:00 Coding example for reading input only and Serial monitor output/results
11:30 Readings are never exact and fluctuate
12:04 Coding example for reading input and assigning pin number and Serial monitor output/results
14:04 Adjusting Switch number to analog value
14:33 Rotary switch end product
15:03 Project example with minimum pin usage
Check out other similar videos in this Electronics playlist:
https://youtube.com/playlist?list=PLqTrJlcRXDhmFr72DRxr4KW-2YMVo5Hrd
Check out Josephine's channel
https://www.youtube.com/channel/UChRIIUpVIG-HMIYoMM3WSSw
#arduino
#rotartyswitch