How to deal with analog pins on arduino mega?

hi all,

for managing a modelrailway project, i wrote a tool-sketch for testing
all peripherie
as mega has more than 8 analog pins, simply i wrote A11, A12..
that does not work !

i a similar thread i found this

const byte pinAssign[16] ={A0, A1, A2 , A3 , A4, A5, A6,A7,
                         A8, A9,A10,A11,A12,A13,A14,A15};

`
but compiler tells me 'A8 was not declared in this scope..

this row is positioned before setup, so guess its global !?

how to correctly adress the pin-numbers higher than A7 ?

Did you forget to select the correct board? This happily compiles for a Mega

const byte pinAssign[16] = {A0, A1, A2 , A3 , A4, A5, A6, A7,
                            A8, A9, A10, A11, A12, A13, A14, A15
                           };
void setup()
{

}

void loop()
{

}
1 Like

thanks,

thats what was !
now the higher pins are accepted !

Before i had some other issues tried with nano and forgot
to switch over:-))

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.