I have something now that almost works. It reads the inByte, looks for the sync byte value 255, then uses splice and some weird counting to build an array that has 7 elements. The problem now is the Channels kind of shift one position with each iteration. For instance, the Channel[1] value will show up in Channel[2], then the next time through it moves to Channel[3] etc, until it shows up in Channel[6] and then it repeats.
void serialEvent(Serial myPort) {
//count = 0;
inByte[0] = myPort.read();
if (count < 7) {
if (inByte[0] == 255 ) {
// Channel = splice(Channel,inByte[0],0);
Channel[0] = 255;
}else {
if (Channel[0] == 255){
Channel = splice(Channel,inByte[0],count+1);
// Channel = append(Channel,inByte[0]);
}
}
for(int i=0;i<7;i++) {
println(i,Channel[i]);
}
count++;
}
count = 0;
}