Oh – I just found out that on the nano pins A6 and A7 are analog only and cannot be used as digital like pins A0-A5. I was really wanting to use them in my project. Therefore, I am looking for away to make them act similarly to digital pins.
Looking at some info online, it appears that the pins (A6 and A7) do not have internal pull ups, however, I am guessing that if I connect a 10K resistor from the Vcc to A6 I can create a pull up causing an analogread() of HIGH. Then if I connect a switch (with GND) to the same A6 pin I could get a LOW reading by pushing the switch. Does this sound correct, and will it work for my purpose? Thank you for any replies
Since you can only use analogRead() on A6 or A7 you won't get "HIGH" or "LOW". You will get "near 1023" and "near 0". You could use (analogRead(A6) > 512) to get a 0 (LOW) or 1 (HIGH).
Thank you for the replies and test code. I will be working on this later tonight. I do have a question about the lack of digital buffers (as noted), what effect does this have. What do the buffers on the other pins do?
As I'm not fluent in English, I hope I didn't misunderstand,
I just reproduced what is written in:
datasheet written by Microchip:
ATmega48A/PA/88A/PA/168A/PA/328/P DS40002061A
Page: 261
Title : • Bit 5:0 – ADC5D...ADC0D: ADC5...0 Digital Input Disable
line n.: 5
Note that ADC pins ADC7 and ADC6 do not have digital input buffers, and therefore do not require Digital Input
Disable bits.
or in the Atmega datasheet written by ATMEL
ATmega48A/PA/88A/PA/168A/PA/328/P
Atmel-8271I-AVR-ATmega-Datasheet_10/2014
Page: 252
Title : • Bit 5:0 – ADC5D...ADC0D: ADC5...0 Digital Input Disable
line n.: 5
Note that ADC pins ADC7 and ADC6 do not have digital input buffers, and therefore do not require Digital Input
Disable bits.
As I'm not fluent in English, I hope I didn't misunderstand,
I just reproduced what is written in:
datasheet written by Microchip:
ATmega48A/PA/88A/PA/168A/PA/328/P DS40002061A
Page: 261
Title : • Bit 5:0 – ADC5D...ADC0D: ADC5...0 Digital Input Disable
line n.: 5
Note that ADC pins ADC7 and ADC6 do not have digital input buffers, and therefore do not require Digital Input
Disable bits.
or in the Atmega datasheet written by ATMEL
ATmega48A/PA/88A/PA/168A/PA/328/P
Atmel-8271I-AVR-ATmega-Datasheet_10/2014
Page: 252
Title : • Bit 5:0 – ADC5D...ADC0D: ADC5...0 Digital Input Disable
line n.: 5
Note that ADC pins ADC7 and ADC6 do not have digital input buffers, and therefore do not require Digital Input
Disable bits.