Go Down

Topic: trouble with void function. (Read 701 times) previous topic - next topic

WonderTiger

Though I still can't get it working... I don't know exactly what i'm doing. Maybe can you give me a push in the right direction and make a start in my code I posted? Right now I'm doing it wrong...

UKHeliBob

Have a look at this.  It may give you a push in the right direction
Code: [Select]
byte Array1[3][2] =
{
  {1,2},
  {3,4},
  {5,6}
};

byte Array2[3][2] =
{
  {11,22},
  {33,44},
  {55,66}
};

void setup()
{
  Serial.begin(9600);
  showArray(Array1);
  Serial.println();
  showArray(Array2); 
}

void loop()
{
}

void showArray(byte passedArray[3][2])
{
  for (byte row =0;row < 3;row++)
  {
    for (byte col =0;col < 2;col++)
    {
      Serial.println(passedArray[row][col]);
    } 
  }
}
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

WonderTiger

Thank you very much! Got it working now :). Now I also understand what they are doing in the link you posted! Thanks again!

Go Up