Thanks UKHeliBob, Your a legend,this tormented me for a bit.
I modified the code a bit to suit being put in the loop as I will be using it in a xml for webserver to grab
int anArray[6][2] = {{12, 1}, {14, 0}, {16, 1}};
boolean needComma = false;
byte bytesPerEntry = sizeof(anArray[0][0]);
byte cols = (sizeof(anArray[0]) / bytesPerEntry);
byte rows = ((sizeof(anArray) / cols) / bytesPerEntry);
byte count = 0;
void setup()
{
Serial.begin(115200);
}
void loop()
{
for (int r = 0; r < rows ; r++)
{
if (anArray[r][1] == 1)
{
if (needComma)
{
Serial.print(",");
}
Serial.print(anArray[r][0]);
needComma = true;
}
if (r == rows - 1)
{
needComma = false;
}
}
Serial.println();
delay(500);
}