Pages: [1]   Go Down
Author Topic: Adressing all pins  (Read 500 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am brand new to Arduino.
Been playing with electronics a long time.
Used to program in C about 10 years ago.
Arduino brings both together  smiley

My question is: how do I address every pin?

Seems a basic place to start with such an awesome thing smiley


Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well kind of a off the wall question, and not sure what you asking about. The Arduino software has commands that allow you to access (read or write)  all the I/O pins one at a time at one command at a time. There is also a way to access I/O pins as 8 bit registers so you can read or write 8 I/O pins at a time.


If that doesn't answer your question, can you clarify what you wish to do with the I/O pins?

Lefty
« Last Edit: August 26, 2009, 09:15:24 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

TY for quick response.

the 6 analog in are 0..5, right?
other side of the board has digital out 1..13
so if analog in 1..5 is pin1..pin5 then what are digital 1..5?
Cant understand why there are two sets of 1..5.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The digital pins are numbered 0-13, often called D0-D13. The analog pins are numbered 0-5 called A0-A5. The Arduino software knows that when you are using analog commands that the A0 to A5 pins are not the same pins as the digital pins D0 to D5.

 To make it a little more confusing, one can, if you wish, to utilize the five analog pins as digital I/O pins by referring to them as pins 14-18.

These pin names and numbers are software definitions and the Arduino software does all the internal mapping to the actual physical pins.

Lefty


Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
To make it a little more confusing, one can, if you wish, to utilize the five analog pins as digital I/O pins by referring to them as pins 14-18.
I'm not understanding something simple here, I think. Which of the six A0-A5 is not usable as digital?
A0=14
A1=15
A2=16
A3=17
A4=18
A5=19
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Which of the six A0-A5 is not usable as digital?

They are all usable as digital pins, my error, my post should have said "as pins 14-19"

Lefty


Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can i mix analog in and digital pins
for example use analog 0 as analog input and analog 1(digital 15) as digital input
Logged

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

Quote
use analog 0 as analog input and analog 1(digital 15) as digital input
Yes, of course.
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.

Pages: [1]   Go Up
Jump to: