EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

noob Q: Arduino Port C analog v digital

Started by Randy Day February 9, 2016
I can't find any clear info on this, hence 
the question: PortC on the Pro Mini is 
described as the 'Analog inputs' A0-A5.

Do they operate as digital inputs if I
use digitalRead() or read PINC? Or are
they pre-configured as analog, and only 
respond to analogRead()?

I could use a couple more digital inputs, 
and I'm wondering about any conflicts to 
watch out for.

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
On 02/09/2016 01:45 PM, Randy Day wrote:
> > I can't find any clear info on this, hence > the question: PortC on the Pro Mini is > described as the 'Analog inputs' A0-A5. > > Do they operate as digital inputs if I > use digitalRead() or read PINC? Or are > they pre-configured as analog, and only > respond to analogRead()? > > I could use a couple more digital inputs, > and I'm wondering about any conflicts to > watch out for. > > --- news://freenews.netfront.net/ - complaints: news@netfront.net --- >
You can use the analog inputs as digital I/O. Just do a pinMode() as you would for any other digital I/O, then use it as a digital pin. You can use A0-A5 or 14-19 as the pin name. See https://www.arduino.cc/en/Tutorial/AnalogInputPins
In article <n9dsac$ujo$1@dont-email.me>, dennis@none.none says...

[snip]

> You can use the analog inputs as digital I/O. Just do a pinMode() as you > would for any other digital I/O, then use it as a digital pin. You can > use A0-A5 or 14-19 as the pin name. See > > https://www.arduino.cc/en/Tutorial/AnalogInputPins
Ah. Thanks for the confirmation! --- news://freenews.netfront.net/ - complaints: news@netfront.net ---

The 2024 Embedded Online Conference