Pages: [1]   Go Down
Author Topic: Analog pins  (Read 1138 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester, New Hampshire
Offline Offline
Edison Member
*
Karma: 4
Posts: 1363
Propmaker
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26179
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
pinMode (14, OUTPUT); // set "analogue" pin 0 to be a digital ouput
Logged

"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.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Waterloo, Canada
Offline Offline
Full Member
***
Karma: 1
Posts: 242
Engineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok.. thanx  smiley
Logged

Pages: [1]   Go Up
Jump to: