MAX patch not receiving data from Arduino code

Esma Kurbegovic's icon

Hi guys! I'm trying to build a prototype for my thesis, which is a music control tool that works with health-tracking sensors. So right now, I have 4 values coming from Arduino code, and I used unpack 0 0 0 0 to read them out separately and I made subpatches to clean it up a bit. I checked the Arduino patch, and the sensor readings work. I closed it to open max and as I touched the sensors, I got no values coming in. Do you know what might be the problem? I also adjusted the scaling to fit the parameters of plugins I wanted to modulate. I'm going to use a macro for some, just so I get a generic number reading. I've attached both codes in the following wetransfer link: https://we.tl/t-DnG685eUgk

PS: im getting these messages in the console: serial: resetting tty attributes (/dev/cu.usbserial-0001), scale: doesn't understand "id"

Jean-Francois Charles's icon

Clearly, your scale object receives something it should not: it looks like it receives something starting with 'id'... Check your patch with [print] objects to see exactly what kind of messages you get. Do you unpack what you think you are unpacking?
PS: a good way to share code (patch snippets) on this forum is to select the objects in your patch, then do Edit -> Copy Compressed, then paste here.

Source Audio's icon

few values you send are floats, you use unpack 0 0 0 0 , all ints.
but the problem is unpack output to left inlet of messages.
that does not produce any output to next objects.

that scale error :


Esma Kurbegovic's icon

Hi guys! Thanks for the replies! I actually managed to fix everything before seeing the replies here. @Jean-Francois, I thought there might be some character limitation to the forums (I didn't know) so I actually shared the compressed code in the link as a note file. I'll be posting it directly here in the future.