I ended up solving it with the following:
In my Processing program, I added a section that paused in a while loop every 32 iterations until it receives feedback from the arduino (and also sends a 'Y' character to let the arduino know that it's paused), then continues with the main void draw()
- void draw() {
- ++waiting;
- if(waiting==32) {
- arduinoPort.write('Y');
- while (1==1) {
- int inByte = arduinoPort.read();
- if(inByte == 78) {
- break;
- }
- }
- waiting = 1;
- }
- else if (hit == 89) {
- Serial.print('N');
- }