Thanks UKHeliBob
It works well & easyish enough (for me) to understand.
I'm trying to filter out the array using a column that's either 1 or 0 when I apply a filtering if statement to it i cant get the commas right this the best I came up with:
Has your code modified:
int anArray[3][2] = {{12, 1}, {14, 0}, {16, 1}};
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)
{
count++;
Serial.print(anArray[r][0]);
if (r <= count)
{
Serial.print(",");
}
if (r == rows - 1)
{
count = 0;
}
}
}
Serial.println();
delay(500);
}