Loading...
Pages: [1]   Go Down
Author Topic: Using analog pins with digitalRead  (Read 306 times)
0 Members and 1 Guest are viewing this topic.
Aptos, California
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Can anyone tell me how I can use the analog pins for inputs using the digitalRead and digitalWrite functions. I would like to reassign my buttons to them so I can use an SD card shield that use pins 11, 12, 13. I also want to use the LCD so I have to move 2 of those pins as well

StanK
Logged

Aptos, California
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Can anyone tell me how I can use the analog pins for inputs using the digitalRead and digitalWrite functions. I would like to reassign my buttons to them so I can use an SD card shield that use pins 11, 12, 13. I also want to use the LCD so I have to move 2 of those pins as well

StanK
Logged

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

Read the note in the following reference, you can use the pin names A0 to A5 with pinmode, digitalwrite and digitalread commands.

http://arduino.cc/en/Reference/PinMode
Logged

Offline Offline
Edison Member
*
Karma: 15
Posts: 1009
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

digitalRead(A0);
digitalRead(14);

Either one works.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 249
Posts: 16563
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey StanK, don't ask the same question in mulitple places please.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Aptos, California
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks,

I thought it might be that simple. I am new to this environment. I like it. Lot's of helpful people here.

StanK
Logged

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

Topics merged.
Don't cross-post - it wastes time.
Logged

Pete, it's a fool looks for logic in the chambers of the human heart.

Aptos, California
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry about double posting. This is my first post and I didn't think I got it in the correct place the first time. I'll be more careful.
I am still finding my way around this web site.

Stan K
Logged

Pages: [1]   Go Up
Print
 
Jump to: