[PD] comport question....

Hans-Christoph Steiner hans at at.or.at
Tue Sep 14 17:32:20 CEST 2010


I think you want something like this (for use with Pd-extended)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: readheartmeter.pd
Type: application/octet-stream
Size: 549 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20100914/3c4aa7d6/attachment.obj>
-------------- next part --------------


.hc

On Sep 14, 2010, at 11:19 AM, Rory Walsh wrote:

> It's been a while since I've posted, I hope everyone is keeping well!
> I'm trying to retrieve data from a heart rate monitor with Pd using
> the comport object. Sending a 'G1' followed by a carriage return to
> the HRM device using a terminal emulator returns something like 32 10
> 61, where 61 is the current heart rate and 10 is the time passed since
> I first queried the heart rate. If I try to print this info in Pd ala:
>
> |comport|
> |
> |sprintf %c|
> |
> |print|
>
> I get something like this:
>
> 3
> 2
> 1
> 0
> 6
> 1
>
> Obviously this isn't much use to me. The data that is passed from the
> serial device is an 8 bit value but I've no idea how to parse it
> correctly. If I don't use sprintf I get the following print out:
>
> print: 51
> print: 32
> print: 49
> print: 48
> print: 50
> print: 32
> print: 48
> print: 32
> print: 13
>
> Any ideas or suggestions on how to parse the data being returned from
> the device?
>
> Rory.
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list



----------------------------------------------------------------------------

Man has survived hitherto because he was too ignorant to know how to  
realize his wishes.  Now that he can realize them, he must either  
change them, or perish.    -William Carlos Williams




More information about the Pd-list mailing list