You’re invoking method remove() inside serialEvent() callback, which is run by the Serial’s Thread btW!
That is a big no, no! You’re better off just using readString() inside serialEvent() to grab the received String.
However, parse that as JSONObject within draw() instead.
You can use the noLoop()/redraw() approach for a much easier event management:
1 Like