void checkMessages(){ char c = Serial.read(); // get the first character while (c != 2){c = Serial.read();} // if its not STX, keep going till it is // (though this is bad!) if (c == 2){ // now that we have STX int val = Serial.read(); while (val == -1){val = Serial.read();} int matrix = val; int row = 0; while (true) { // loop through all new date till we get ETX //byte val = Serial.read(); //scratch += c; val = Serial.read(); while (val == -1){val = Serial.read();} lc.setColumn(matrix, row, val); row++; if (row>=8) { break; } } Serial.print("Got a message for matrix"); Serial.println(matrix); }}