Go Down

Topic: Analog pins (Read 1 time) previous topic - next topic

000

Is it possible to take an out from the analog pins? Say a particular value of voltage... or can analog pins do inputs alone?

scswift

There is an analogwrite command which you can use with certain digital pins, but it doesn't output different voltages.  It turns the pin on and off really fast, leaving it off longer for lower values.  This is called pulse width modulation, or PWM.  PWM will let you do certain things like dim an LED, but it won't let you play back sound on a piezo speaker.

But to answer your question about different voltages from the analog pins... no.  To output different voltages you'd need a DAC IC, or you'd have to wire a bunch of pins together in what is known as a resistor ladder.

000

I know abt the PWM in some digital pins. So it isnt possible to do any output via analog pins? Its merely input alone?

AWOL

Quote
So it isnt possible to do any output via analog pins? Its merely input alone

You can use the analogue pins as digital I/O pins.
On a Duemilenova, they are then treated simply as digital pins 14 to 19.
e.g.
Code: [Select]
pinMode (14, OUTPUT); // set "analogue" pin 0 to be a digital ouput
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

000

Is this possible on older boards? like atmega 8 boards?

000

I am just trying to know if its possible to do any kind of output from analog pins. I mean in older Atmega 8 boards.

Mitch_CA

The Arduino analog pins connect to an ADC.  It sounds like you are wondering if they can also act as a DAC.
They cannot.

000


Go Up