HELP : ATMega328P_AU - Using A6 & A7 as DIGITAL pins

with regard to ATMEGA328P_AU...

Has anyone had any success in using analog pins A6 and A7 as DIGITAL pins ??

I dont have anymore pins I could use and need these as digital inputs and I have my miserable face on !

Ta, Bob :frowning:

I am not sure but, i thought i read some where here these cannot be used as digital pins.

A6, A7 are analog input only. One can read and react to them as if digital inputs tho:

if (analogRead(A7) >= 613){ 
// HIGH Input for ~3V (of 5V)
}
else {
// LOW INPUT for everything else; not really ideal as LOW is <0.9V
}

Cheers Larry and Bob, just as I thought, its a shame that I have to waste time doing and analog read though

Thanks for the snippet of Code Bob, I shall do something like that, unless I can swap something else around, trouble is I am using these pins for reading switch inputs so they will be read pretty frequently

Does anyone know how long it takes to do an analog read ?

Cheers, Bob

A quick check reveals 100 readings takes about 11308uS.
On a UNO 16MHZ board.

LarryD:
A quick check reveals 100 readings takes about 11308uS.
On a UNO 16MHZ board.

Jeez, thats like FOREVER !! lol