#include <Audio.h>
AudioInputTDM tdm1; //xy=172,228
AudioRecordQueue queue9; //xy=428,202
AudioRecordQueue queue7; //xy=430,159
AudioRecordQueue queue5; //xy=434,117
AudioRecordQueue queue1; //xy=439,34
AudioRecordQueue queue3; //xy=439,78
AudioRecordQueue queue6; //xy=554,118
AudioRecordQueue queue8; //xy=554,159
AudioRecordQueue queue10; //xy=554,201
AudioRecordQueue queue2; //xy=559,35
AudioRecordQueue queue4; //xy=559,77
AudioConnection patchCord1(tdm1, 0, queue1, 0);
AudioConnection patchCord2(tdm1, 1, queue2, 0);
AudioConnection patchCord3(tdm1, 2, queue3, 0);
AudioConnection patchCord4(tdm1, 3, queue4, 0);
AudioConnection patchCord5(tdm1, 4, queue5, 0);
AudioConnection patchCord6(tdm1, 5, queue6, 0);
AudioConnection patchCord7(tdm1, 6, queue7, 0);
AudioConnection patchCord8(tdm1, 7, queue8, 0);
AudioConnection patchCord9(tdm1, 8, queue9, 0);
AudioConnection patchCord10(tdm1, 9, queue10, 0);
int16_t* queue1DataA;
int16_t* queue2DataA;
int16_t* queue3DataA;
int16_t* queue4DataA;
int16_t* queue5DataA;
int16_t* queue6DataA;
int16_t* queue7DataA;
int16_t* queue8DataA;
int16_t* queue9DataA;
int16_t* queue10DataA;
int16_t* queue1DataB;
int16_t* queue2DataB;
int16_t* queue3DataB;
int16_t* queue4DataB;
int16_t* queue5DataB;
int16_t* queue6DataB;
int16_t* queue7DataB;
int16_t* queue8DataB;
int16_t* queue9DataB;
int16_t* queue10DataB;
int16_t* queue1DataC;
int16_t* queue2DataC;
int16_t* queue3DataC;
int16_t* queue4DataC;
int16_t* queue5DataC;
int16_t* queue6DataC;
int16_t* queue7DataC;
int16_t* queue8DataC;
int16_t* queue9DataC;
int16_t* queue10DataC;
int16_t* queue1DataD;
int16_t* queue2DataD;
int16_t* queue3DataD;
int16_t* queue4DataD;
int16_t* queue5DataD;
int16_t* queue6DataD;
int16_t* queue7DataD;
int16_t* queue8DataD;
int16_t* queue9DataD;
int16_t* queue10DataD;
int16_t* queue1DataE;
int16_t* queue2DataE;
int16_t* queue3DataE;
int16_t* queue4DataE;
int16_t* queue5DataE;
int16_t* queue6DataE;
int16_t* queue7DataE;
int16_t* queue8DataE;
int16_t* queue9DataE;
int16_t* queue10DataE;
int16_t* queue1DataF;
int16_t* queue2DataF;
int16_t* queue3DataF;
int16_t* queue4DataF;
int16_t* queue5DataF;
int16_t* queue6DataF;
int16_t* queue7DataF;
int16_t* queue8DataF;
int16_t* queue9DataF;
int16_t* queue10DataF;
int16_t* queue1DataG;
int16_t* queue2DataG;
int16_t* queue3DataG;
int16_t* queue4DataG;
int16_t* queue5DataG;
int16_t* queue6DataG;
int16_t* queue7DataG;
int16_t* queue8DataG;
int16_t* queue9DataG;
int16_t* queue10DataG;
int16_t* queue1DataH;
int16_t* queue2DataH;
int16_t* queue3DataH;
int16_t* queue4DataH;
int16_t* queue5DataH;
int16_t* queue6DataH;
int16_t* queue7DataH;
int16_t* queue8DataH;
int16_t* queue9DataH;
int16_t* queue10DataH;
int16_t* queue1DataI;
int16_t* queue2DataI;
int16_t* queue3DataI;
int16_t* queue4DataI;
int16_t* queue5DataI;
int16_t* queue6DataI;
int16_t* queue7DataI;
int16_t* queue8DataI;
int16_t* queue9DataI;
int16_t* queue10DataI;
int16_t* queue1DataJ;
int16_t* queue2DataJ;
int16_t* queue3DataJ;
int16_t* queue4DataJ;
int16_t* queue5DataJ;
int16_t* queue6DataJ;
int16_t* queue7DataJ;
int16_t* queue8DataJ;
int16_t* queue9DataJ;
int16_t* queue10DataJ;
int sig1;
int sig2;
int sig3;
int sig4;
int sig5;
int thresh = 50000;
int rowCounter;
int mic1[2176];
int mic2[2176];
int mic3[2176];
int mic4[2176];
int mic5[2176];
bool tripped = false;
int rowPrinter=0;
void setup() {
Serial.begin(9600);
AudioMemory(512);
// put your setup code here, to run once:
rowPrinter=0;
queue1.begin();
queue2.begin();
queue3.begin();
queue4.begin();
queue5.begin();
queue6.begin();
queue7.begin();
queue8.begin();
queue9.begin();
queue10.begin();
}
void printMics(int sendex)
{
for (int i = 0; i < sendex; i++)
{
rowPrinter++;
sig1 = mic1[i];
sig2 = mic2[i];
sig3 = mic3[i];
sig4 = mic4[i];
sig5 = mic5[i];
Serial.print(rowPrinter);
if(sig1>=10 || sig1<=-10)
{
if(sig1>=100 || sig1<=-100)
{
if(sig1>=1000 || sig1<=-1000)
{
if(sig1>=10000 || sig1<=-10000)
{
if(sig1>=100000 || sig1<=-100000)
{
if(sig1>=1000000 || sig1<=-1000000)
{
if(sig1>=10000000 || sig1<=-10000000)
{
Serial.print(", ");
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
if(sig1>0)
{
Serial.print(" ");
}
Serial.print(sig1);
if(sig2>=10 || sig2<=-10)
{
if(sig2>=100 || sig2<=-100)
{
if(sig2>=1000 || sig2<=-1000)
{
if(sig2>=10000 || sig2<=-10000)
{
if(sig2>=100000 || sig2<=-100000)
{
if(sig2>=1000000 || sig2<=-1000000)
{
if(sig2>=10000000 || sig2<=-10000000)
{
Serial.print(", ");
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
if(sig1>0)
{
Serial.print(" ");
}
Serial.print(sig2);
if(sig3>=10 || sig3<=-10)
{
if(sig3>=100 || sig3<=-100)
{
if(sig3>=1000 || sig3<=-1000)
{
if(sig3>=10000 || sig3<=-10000)
{
if(sig3>=100000 || sig3<=-100000)
{
if(sig3>=1000000 || sig3<=-1000000)
{
if(sig3>=10000000 || sig3<=-10000000)
{
Serial.print(", ");
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
if(sig1>0)
{
Serial.print(" ");
}
Serial.print(sig3);
if(sig4>=10 || sig4<=-10)
{
if(sig4>=100 || sig4<=-100)
{
if(sig4>=1000 || sig4<=-1000)
{
if(sig4>=10000 || sig4<=-10000)
{
if(sig4>=100000 || sig4<=-100000)
{
if(sig4>=1000000 || sig4<=-1000000)
{
if(sig4>=10000000 || sig4<=-10000000)
{
Serial.print(", ");
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
if(sig1>0)
{
Serial.print(" ");
}
Serial.print(sig4);
if(sig5>=10 || sig5<=-10)
{
if(sig5>=100 || sig5<=-100)
{
if(sig5>=1000 || sig5<=-1000)
{
if(sig5>=10000 || sig5<=-10000)
{
if(sig5>=100000 || sig5<=-100000)
{
if(sig5>=1000000 || sig5<=-1000000)
{
if(sig5>=10000000 || sig5<=-10000000)
{
Serial.print(", ");
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
}
else
{
Serial.print(", ");
}
if(sig1>0)
{
Serial.print(" ");
}
Serial.print(sig5);
Serial.print(", ");
Serial.println(i);
delay(1);
}
}
void loop() {
// put your main code here, to run repeatedly:
if (queue1.available()>9 && queue2.available()>9 && queue3.available()>9 && queue4.available()>9 && queue5.available()>9 && queue6.available()>9 && queue7.available()>9 && queue8.available()>9 && queue9.available()>9 && queue10.available()>9)
{
queue1.end();
queue2.end();
queue3.end();
queue4.end();
queue5.end();
queue6.end();
queue7.end();
queue8.end();
queue9.end();
queue10.end();
queue1DataA = queue1.readBuffer();
queue2DataA = queue2.readBuffer();
queue3DataA = queue3.readBuffer();
queue4DataA = queue4.readBuffer();
queue5DataA = queue5.readBuffer();
queue6DataA = queue6.readBuffer();
queue7DataA = queue7.readBuffer();
queue8DataA = queue8.readBuffer();
queue9DataA = queue9.readBuffer();
queue10DataA = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataB = queue1.readBuffer();
queue2DataB = queue2.readBuffer();
queue3DataB = queue3.readBuffer();
queue4DataB = queue4.readBuffer();
queue5DataB = queue5.readBuffer();
queue6DataB = queue6.readBuffer();
queue7DataB = queue7.readBuffer();
queue8DataB = queue8.readBuffer();
queue9DataB = queue9.readBuffer();
queue10DataB = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataC = queue1.readBuffer();
queue2DataC = queue2.readBuffer();
queue3DataC = queue3.readBuffer();
queue4DataC = queue4.readBuffer();
queue5DataC = queue5.readBuffer();
queue6DataC = queue6.readBuffer();
queue7DataC = queue7.readBuffer();
queue8DataC = queue8.readBuffer();
queue9DataC = queue9.readBuffer();
queue10DataC = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataD = queue1.readBuffer();
queue2DataD = queue2.readBuffer();
queue3DataD = queue3.readBuffer();
queue4DataD = queue4.readBuffer();
queue5DataD = queue5.readBuffer();
queue6DataD = queue6.readBuffer();
queue7DataD = queue7.readBuffer();
queue8DataD = queue8.readBuffer();
queue9DataD = queue9.readBuffer();
queue10DataD = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataE = queue1.readBuffer();
queue2DataE = queue2.readBuffer();
queue3DataE = queue3.readBuffer();
queue4DataE = queue4.readBuffer();
queue5DataE = queue5.readBuffer();
queue6DataE = queue6.readBuffer();
queue7DataE = queue7.readBuffer();
queue8DataE = queue8.readBuffer();
queue9DataE = queue9.readBuffer();
queue10DataE = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataF = queue1.readBuffer();
queue2DataF = queue2.readBuffer();
queue3DataF = queue3.readBuffer();
queue4DataF = queue4.readBuffer();
queue5DataF = queue5.readBuffer();
queue6DataF = queue6.readBuffer();
queue7DataF = queue7.readBuffer();
queue8DataF = queue8.readBuffer();
queue9DataF = queue9.readBuffer();
queue10DataF = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataG = queue1.readBuffer();
queue2DataG = queue2.readBuffer();
queue3DataG = queue3.readBuffer();
queue4DataG = queue4.readBuffer();
queue5DataG = queue5.readBuffer();
queue6DataG = queue6.readBuffer();
queue7DataG = queue7.readBuffer();
queue8DataG = queue8.readBuffer();
queue9DataG = queue9.readBuffer();
queue10DataG = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataH = queue1.readBuffer();
queue2DataH = queue2.readBuffer();
queue3DataH = queue3.readBuffer();
queue4DataH = queue4.readBuffer();
queue5DataH = queue5.readBuffer();
queue6DataH = queue6.readBuffer();
queue7DataH = queue7.readBuffer();
queue8DataH = queue8.readBuffer();
queue9DataH = queue9.readBuffer();
queue10DataH = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataI = queue1.readBuffer();
queue2DataI = queue2.readBuffer();
queue3DataI = queue3.readBuffer();
queue4DataI = queue4.readBuffer();
queue5DataI = queue5.readBuffer();
queue6DataI = queue6.readBuffer();
queue7DataI = queue7.readBuffer();
queue8DataI = queue8.readBuffer();
queue9DataI = queue9.readBuffer();
queue10DataI = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
queue1DataJ = queue1.readBuffer();
queue2DataJ = queue2.readBuffer();
queue3DataJ = queue3.readBuffer();
queue4DataJ = queue4.readBuffer();
queue5DataJ = queue5.readBuffer();
queue6DataJ = queue6.readBuffer();
queue7DataJ = queue7.readBuffer();
queue8DataJ = queue8.readBuffer();
queue9DataJ = queue9.readBuffer();
queue10DataJ = queue10.readBuffer();
queue1.freeBuffer();
queue2.freeBuffer();
queue3.freeBuffer();
queue4.freeBuffer();
queue5.freeBuffer();
queue6.freeBuffer();
queue7.freeBuffer();
queue8.freeBuffer();
queue9.freeBuffer();
queue10.freeBuffer();
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataA[i] << 8) + (queue2DataA[i] >> 8);
sig2 = (queue3DataA[i] << 8) + (queue4DataA[i] >> 8);
sig3 = (queue5DataA[i] << 8) + (queue6DataA[i] >> 8);
sig4 = (queue7DataA[i] << 8) + (queue8DataA[i] >> 8);
sig5 = (queue9DataA[i] << 8) + (queue10DataA[i] >> 8);
mic1[i]=sig1;
mic2[i]=sig2;
mic3[i]=sig3;
mic4[i]=sig4;
mic5[i]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataB[i] << 8) + (queue2DataB[i] >> 8);
sig2 = (queue3DataB[i] << 8) + (queue4DataB[i] >> 8);
sig3 = (queue5DataB[i] << 8) + (queue6DataB[i] >> 8);
sig4 = (queue7DataB[i] << 8) + (queue8DataB[i] >> 8);
sig5 = (queue9DataB[i] << 8) + (queue10DataB[i] >> 8);
mic1[i+128]=sig1;
mic2[i+128]=sig2;
mic3[i+128]=sig3;
mic4[i+128]=sig4;
mic5[i+128]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataC[i] << 8) + (queue2DataC[i] >> 8);
sig2 = (queue3DataC[i] << 8) + (queue4DataC[i] >> 8);
sig3 = (queue5DataC[i] << 8) + (queue6DataC[i] >> 8);
sig4 = (queue7DataC[i] << 8) + (queue8DataC[i] >> 8);
sig5 = (queue9DataC[i] << 8) + (queue10DataC[i] >> 8);
mic1[i+256]=sig1;
mic2[i+256]=sig2;
mic3[i+256]=sig3;
mic4[i+256]=sig4;
mic5[i+256]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataD[i] << 8) + (queue2DataD[i] >> 8);
sig2 = (queue3DataD[i] << 8) + (queue4DataD[i] >> 8);
sig3 = (queue5DataD[i] << 8) + (queue6DataD[i] >> 8);
sig4 = (queue7DataD[i] << 8) + (queue8DataD[i] >> 8);
sig5 = (queue9DataD[i] << 8) + (queue10DataD[i] >> 8);
mic1[i+384]=sig1;
mic2[i+384]=sig2;
mic3[i+384]=sig3;
mic4[i+384]=sig4;
mic5[i+384]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataE[i] << 8) + (queue2DataE[i] >> 8);
sig2 = (queue3DataE[i] << 8) + (queue4DataE[i] >> 8);
sig3 = (queue5DataE[i] << 8) + (queue6DataE[i] >> 8);
sig4 = (queue7DataE[i] << 8) + (queue8DataE[i] >> 8);
sig5 = (queue9DataE[i] << 8) + (queue10DataE[i] >> 8);
mic1[i+512]=sig1;
mic2[i+512]=sig2;
mic3[i+512]=sig3;
mic4[i+512]=sig4;
mic5[i+512]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataF[i] << 8) + (queue2DataF[i] >> 8);
sig2 = (queue3DataF[i] << 8) + (queue4DataF[i] >> 8);
sig3 = (queue5DataF[i] << 8) + (queue6DataF[i] >> 8);
sig4 = (queue7DataF[i] << 8) + (queue8DataF[i] >> 8);
sig5 = (queue9DataF[i] << 8) + (queue10DataF[i] >> 8);
mic1[i+640]=sig1;
mic2[i+640]=sig2;
mic3[i+640]=sig3;
mic4[i+640]=sig4;
mic5[i+640]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataG[i] << 8) + (queue2DataG[i] >> 8);
sig2 = (queue3DataG[i] << 8) + (queue4DataG[i] >> 8);
sig3 = (queue5DataG[i] << 8) + (queue6DataG[i] >> 8);
sig4 = (queue7DataG[i] << 8) + (queue8DataG[i] >> 8);
sig5 = (queue9DataG[i] << 8) + (queue10DataG[i] >> 8);
mic1[i+768]=sig1;
mic2[i+768]=sig2;
mic3[i+768]=sig3;
mic4[i+768]=sig4;
mic5[i+768]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataH[i] << 8) + (queue2DataH[i] >> 8);
sig2 = (queue3DataH[i] << 8) + (queue4DataH[i] >> 8);
sig3 = (queue5DataH[i] << 8) + (queue6DataH[i] >> 8);
sig4 = (queue7DataH[i] << 8) + (queue8DataH[i] >> 8);
sig5 = (queue9DataH[i] << 8) + (queue10DataH[i] >> 8);
mic1[i+896]=sig1;
mic2[i+896]=sig2;
mic3[i+896]=sig3;
mic4[i+896]=sig4;
mic5[i+896]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataI[i] << 8) + (queue2DataI[i] >> 8);
sig2 = (queue3DataI[i] << 8) + (queue4DataI[i] >> 8);
sig3 = (queue5DataI[i] << 8) + (queue6DataI[i] >> 8);
sig4 = (queue7DataI[i] << 8) + (queue8DataI[i] >> 8);
sig5 = (queue9DataI[i] << 8) + (queue10DataI[i] >> 8);
mic1[i+1024]=sig1;
mic2[i+1024]=sig2;
mic3[i+1024]=sig3;
mic4[i+1024]=sig4;
mic5[i+1024]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
for (int i = 0; i < 128; i++)
{
sig1 = (queue1DataJ[i] << 8) + (queue2DataJ[i] >> 8);
sig2 = (queue3DataJ[i] << 8) + (queue4DataJ[i] >> 8);
sig3 = (queue5DataJ[i] << 8) + (queue6DataJ[i] >> 8);
sig4 = (queue7DataJ[i] << 8) + (queue8DataJ[i] >> 8);
sig5 = (queue9DataJ[i] << 8) + (queue10DataJ[i] >> 8);
mic1[i+1152]=sig1;
mic2[i+1152]=sig2;
mic3[i+1152]=sig3;
mic4[i+1152]=sig4;
mic5[i+1152]=sig5;
if (!tripped && ((sig1 >= thresh || sig1 <= -thresh) || (sig2 >= thresh || sig2 <= -thresh) || (sig3 >= thresh || sig3 <= -thresh) || (sig4 >= thresh || sig4 <= -thresh) || (sig5 >= thresh || sig5 <= -thresh)))
{
tripped = true;
}
rowCounter++;
}
if(tripped)
{
printMics(rowCounter);
tripped = false;
}
rowCounter=0;
queue1.clear();
queue2.clear();
queue3.clear();
queue4.clear();
queue5.clear();
queue6.clear();
queue7.clear();
queue8.clear();
queue9.clear();
queue10.clear();
queue1.begin();
queue2.begin();
queue3.begin();
queue4.begin();
queue5.begin();
queue6.begin();
queue7.begin();
queue8.begin();
queue9.begin();
queue10.begin();
}
if (Serial.available())
{
if (Serial.read() == '0')
{
rowPrinter=0;
}
}
}