Yeah, thats a basic knowledge of electronics so therefore im curious, what's the difference between Analog and Digital inputs.
As i get it, digital is like it sounds, some software that passes in a digital value (for eg. birghtness of a led).
But analog part confuses me a little since most of the components that one can attach to arduino, still send digital data, so what exactly is the analog inputs for ?
For instance measure a voltage in the range 0..5V to a resulution of about 5mV. More and more sensor ICs these days provide their own A/D converters and interface digitally, but sometimes not. Also you can monitor battery voltages, turn an LED into an ambient light sensor, read the output of an instrumentation amplifier - analog inputs have uses.
Sometimes you need more accuracy than the built-in 10 bit ADC of course, in which case things are more complex.
"Sometimes you need more accuracy than the built-in 10 bit ADC of course, in which case things are more complex."
But just barely - you use a part such as MCP3201, a 12 bit ADC that sends its output via an SPI transfer.
But analog part confuses me a little since most of the components that one can attach to arduino, still send digital data, so what exactly is the analog inputs for ?
Let's say you are building a thermometer or a thermostat. You can get a special chip that puts-out a (analog) voltage proportional to the temperature (or you can build a similar circuit with a thermocouple).
Or, I built a lighting effect that's controlled by the music. The louder the music, the higher the voltage. (There is some analog "conditioning" circuitry to convert the normal analog AC audio signal into a DC voltage that varies with the loudness.)
Analogue - continuous signal, can take on any value.
Digital - signal that can take on only one of two states, usually referred to as HIGH and LOW or TRUE and FALSE