[PD] Pduino issue

Roman Haefeli reduzent at gmail.com
Tue Apr 18 23:01:19 CEST 2023


On Mon, 2023-04-17 at 15:14 -0500, Rick Snow wrote:
>  Ultimately this person would like to control about 40 solenoids with
> an arduino mega and a pd patch.

I only noticed now that the intention is to control solenoids.  I was
once triggering solenoids with Pd and an Arduino and was not quite
satisfied with StandardFirmata because of the jitter between the 'on'
and 'off' message. Thus, I implemented a simple protocol where the pin
number and pulse length are part of the same message, so that the
timing is only dependent on the boards own clock and not the serial
bus. This allowed for more fine-grained control over the solenoid's
velocity. 

The code (sketch and abstraction) is here:
https://netpd.org/~roman/tmp/solenoiduino.zip

Please note, that the protocol can only control 16 solenoids and has a
timing resolution of 2*10 (1024 steps). You could add two more bits to
the solenoids addressing and remove two bits from the timing. Or you
could extend the protocol to a message length of 3 bytes.

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20230418/9b894c97/attachment-0001.sig>


More information about the Pd-list mailing list