I am setting up Trill Square with an Arduino MKR1010 Wifi. Arduino square-print example sketch works fine - for a one-finger touch, the Serial data returned looks like:
V[1]: 768 235 H[1]: 1152 197
This seems right. I then downloaded Processing (v3.5.4) and successfully installed the Trill library.
Note: in the TrillSquare Processing example, changing println(Serial.list()); to printArray(Serial.list)); in the void setup block displays the indexes of the available COM ports, and removes an initialization error. I only have one available COM port, which means that I had to change int gPortNumber to match the given array value - in this case, it was 0.
[Solved using this thread: "PRocessing and Arduino not communicating CAn't open com port"]
However, after successful initialization, touching anywhere on the Trill surface generates this error:
java.lang.NumberFormatException: For input string: "V[1]:"
I have debugged this as far as the Serial function, which processes new Serial data:
void serialEvent(Serial p) {
// Read data from the serial buffer as string
String str = p.readString();
try {
// Parse string to extract Trill touch information
trill.serialParse(str);
}
catch(RuntimeException e) {
e.printStackTrace();
}
}
The Arduino string doesn't seem to be parsing properly. Any ideas on how to fix this?
Thanks!