digital function of arduino is not clearly ???

hi! i have arduino nano-board which using atmega238
and i can see pins has marked A1-A7 and D1-D13
and this is syntax for digital function of arduino language digitalWrite(pin, value)
my question is how to transmit parameter to control A1 or ....
i cant find pin define whit correct number
thank very much

A0 to A7 = D14 to D21

oh hit hard to know , if i write digitaWrite(5,1) which pin will be drive hard A5 OR D5 . and if i want PORT A to write value 6 how i can do it
thank you !!!

You can use the symbols A1, A2 ... A7 etc...

i.e.

pinMode(A1, OUTPUT);
digitalWrite(A1, HIGH);

The variant pins_arduino.h file defines the symbols A0, A1, etc... (however many there are) to be the corresponding digital pin numbers.

With respect to writing to "PORT A" you are out of luck with respect to Arduino since Arduino does not support anything but their abstracted i/o using the arduino core i/o library with routines like digitalWrite(), digitalRead(), pinMode().

If you want to write to the AVR port register directly you have to step outside of what Arduino can provide and stomp on the hardware directly using the macros provided by the avr-gcc toolset and its avrlibC to do AVR raw port i/o.

--- bill

A0 to A7 = D14 to D21

Sorry, wrong.
A6 and A7 on the Nano are analogue-only.

bperrybap:
You can use the symbols A1, A2 ... A7 etc...

i.e.

pinMode(A1, OUTPUT);

digitalWrite(A1, HIGH);




The variant pins_arduino.h file defines the symbols A0, A1, etc... (however many there are) to be the corresponding digital pin numbers.

With respect to writing to "PORT A" you are out of luck with respect to Arduino since Arduino does not support anything but their abstracted i/o using the arduino core i/o library with routines like digitalWrite(), digitalRead(), pinMode().

If you want to write to the AVR port register directly you have to step outside of what Arduino can provide and stomp on the hardware directly using the macros provided by the avr-gcc toolset and its avrlibC to do AVR raw port i/o.



--- bill

thank so much