Split Teensy serial data

Robert Karl's icon

So I've been trying to get serial data into Max.
I just can't seem to figure out how to separate 2 incoming numbers, a potentiometer with a range of 1023 and a button which sends either 0 or 1. In de serial monitor in Arduino I get the correct values beneath each other, in max I can only get the potentiometer. Any help would be greatly appreciated.

POTMETER.maxpat
Max Patch

Source Audio's icon

If you want to receive 2 values, you must send them as list,
or prepend some id to be able to route them separately.

if you send first value using print, and last value using printf
you can group them into list in max using sel 13 10
carriage return or line feed detection

Serial.print(Pot); Serial.print(" "); Serial.printf(Button);