Go Down

Topic: Using analog pins with digitalRead (Read 544 times) previous topic - next topic

StanK

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

StanK

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

retrolefty

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

WizenedEE

digitalRead(A0);
digitalRead(14);

Either one works.

CrossRoads

Hey StanK, don't ask the same question in mulitple places please.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

StanK

Thanks,

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

StanK

AWOL

Topics merged.
Don't cross-post - it wastes time.
"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.

StanK

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy