Using two different readStringUntil "characters"

Dunno much about Arduino, but it seems correct to me. :flushed:
Although you can simplify it a lil’ more like this: :nerd_face:

Serial.print(x1);
Serial.write('\t');
Serial.println(y1);

I’m also noticing you’re sending 2 int values, not float 1s: :see_no_evil:

int x1 = map(x, 1023, 0, -10, 10);
int y1 = map(y, 0, 1023, -10, 10);

So it’ll be more efficient to replace all float to int in the Processing side as well. :bulb:

Also in your Processing code side, I’ve spotted some bugs which wouldn’t be there if you had followed my own sketch model more closely! :roll_eyes:

Where’s Serial::bufferUntil() after this statement: :grimacing:
port = new Serial(this, "COM12", 115200);

And do not use Serial::available() when using serialEvent()! :no_good_man:

1 Like