Two Dimensional Arrays....

Anyone know if it is possibly to have two dimensional arras on the Arduino?

Im trying to write a menu system for the LCD keypad shield.

Letting me have a list of options, that I can go deeper into... Then select something and come out again.

Anyone give me any help on this?

byte my2dArray[2][3]={
  {1,2,3},
  {2,3,4}
};

:slight_smile:

How do you access the data in an array like this? Is it like:
my2dArray[1][1] is 3
my2dArray[0][2] is 3
my2dArray[1][2] is 4?
I'm assuming both the columns and rows are zero-indexed, but I don't know about the bracket setup.

The best way to get an answer to your question is to fire up the IDE and start typing Serial.print statements. :wink:

How do you access the data in an array like this? Is it like:
my2dArray[1][1] is 3
my2dArray[0][2] is 3
my2dArray[1][2] is 4?
I'm assuming both the columns and rows are zero-indexed, but I don't know about the bracket setup.

Ayelix, you have it exactly right.

Regards,

-Mike