Looped Array to print as csv

PaulS:
You are using the value in one row to determine whether to print the value in the other row. You are not printing both rows.

You will need to make two passes through the array, counting the number of values to print on the first pass, and then printing them on the second pass.

For the second pass, replace the 8 with the number of ones counted on the first pass.

Im about to test it just have to rig up, is this what you mean?

  for (int i = 0; i < 8; i++)
  {    
  if (AlarmAddress[1][i] == 1)
    for (int j = 0; j < i; j++)
    {
    Serial.print(AlarmAddress[0][i]);
        if(j != i - 1)
        {
          Serial.print(",");
        }
        else
        {
          Serial.println();
        }
     }
  }