How should i determine whether to use input as analog or digital and same for output too?
closed as too broad by Code Gorilla, jfpoilpret, jose can u c, Enric Blanco, Michel Keijzers Apr 6 '17 at 11:54
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You will use digital pin modes when dealing with signals that are either "on" or "off", such as an LED, a switch, or another digital IC.
Analog inputs are used when you want to read the voltage potential of something. This is typically used to read analog sensors. Analog outputs are not really analog at all on the Arduino. Instead, the Arduino uses something called PWM to create a pseudo-analog signal.
You can read more about analog and digital here: https://learn.sparkfun.com/tutorials/analog-vs-digital