Arduino pin mappinig

from this page: http://arduino.cc/en/Main/arduinoBoardMega2560 I'm trying to use A0-A4 pins:

  pinMode (0, OUTPUT);
  pinMode (1, OUTPUT);
  pinMode (2, OUTPUT);
  pinMode (3, OUTPUT);
  pinMode (4, OUTPUT);
  digitalWrite (1,HIGH);
  digitalWrite (2,HIGH);
  digitalWrite (3,HIGH);
  digitalWrite (4,HIGH);

then after 1 minute:

 digitalWrite (1,LOW); 
 digitalWrite (2,LOW); 
 digitalWrite (3,LOW); 
 digitalWrite (4,LOW);

The problem: on these pins always LOW level what I'm doing wrong?

looks like it should work. How do you get 1 minute later?

http://arduino.cc/en/Reference/DigitalWrite

Try doing the digital writes to A1-A4 instead of to 1-4. 1 - 4 are the digital pins D1 to D4.

a0.... a15 are analog inputs, digital writes won't work. You should check the level on the digial pins labeled 0 , 1.... BTW I would avoid to use 0,1 as they have a special purpose.

thank you, that is working:

  digitalWrite (A1,HIGH);
  digitalWrite (A2,HIGH);
  digitalWrite (A3,HIGH);
  digitalWrite (A4,HIGH);

what type these variable should be

which variables? A1 etc are #defines for the higher digital pins, starting from 14 IIRC so

digitalWrite (A1,HIGH);

is the same as

digitalWrite (15,HIGH);


Rob

zapx64: a0.... a15 are analog inputs, digital writes won't work.

Sorry, but that's not true. On an uno, A0 to A5 all work as full digital pins and can also act as analog pins. On some 328 based arduinos such as the nano, there's also an A6 and A7 which are analog inputs only without digital pins. The mega is similar -- all the analog inputs act as digital GPIO(standard pins).

Well then I was wrong on that one...