I will be using an Arduino to send messages via serial to Max. This is the protocol I have come up with (uses 8 bits):
Bit 0 – Mode switch 1 (Top button on far right of my board)
Bit 1 – Mode switch 2 (Bottom button on far right of my board)
Bit 2 through 4 – 3 bits to give Y axis position of button, 0, 1, or 2
Bits 5 through 7 – 3 bits to give X axis position of buton presses, 0, 1, 2, 3, 4, 5, or 6
I will send a newline character after each message so I know where a message begins and ends.
I need to isolate these individual bits and convert them to an integer in my Max patch so I can do something meaningful with them, all I can find is audio-rate bit operations, not what I want. Can anyone tell me what to do?
Also, how to I paste my patch I currently have in the forum? Can’t figure out how to that. Thanks
Post your Max patch by going: Edit Mode/Edit/Copy Compressed; then paste onto your post. A jpeg or other of your Arduino program would also help. Meanwhile look at the helpfile for the [zl] object (right/alt click on it). I access my Arduino serial ANALOG data by converting to ASCII and using the [select] object (select 255), but your BINARY ‘matrix-like’ data looks a little more complex than i usually run in to.