[PD] routing serial data

ray Y raybuay at hotmail.com
Fri Oct 23 19:25:22 CEST 2015

i used Serial.write in the arduino sketch so i should be getting 4

8 bit bytes. i will check your examples and see how it goes


De: Alexandros Drymonitis <adrcki at gmail.com>
Enviado: viernes, 23 de octubre de 2015 10:07 a. m.
Para: ray Y; PD-list
Asunto: Re: [PD] routing serial data

Including list too

On Fri, Oct 23, 2015 at 8:01 PM, ray Y <raybuay at hotmail.com<mailto:raybuay at hotmail.com>> wrote:

the print object at the output of comport (for reference)

yeah, that was the first thing i tried but i don't know why it does not

work with the serial stream like it does with a normal list. i tried adding

commas between the values in the arduino sketch but no chance of

splitting the data into each atom in PD

[comport] spits values one by one (actually bytes, so if a value is greater than one byte, it will be split, depending on the way you'll print it from the Arduino - Serial.print or Serial.write). you'll have to assemble them into a list (check help patch of [list] to see how to make a growing list), or make a counter and bang it on every output of [comport], pack the [comport] value with the counter value prepended and use [route].
I've made some abstractions to facilitate the communication between the Arduino and Pd, they'll might work for you. There're here https://github.com/alexdrymonitis/Arduino_Pd
The [serial_print] abstraction can use the comma as a value delimiter (if you're on Pd-extended, use [serial_print_extended] instead).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151023/ce765304/attachment.html>

More information about the Pd-list mailing list