<div dir="ltr"><div><div>Hi Simon,<br></div>I'm using an interrupt interface for reading the digital inputs but polling for reading the analog ones. Probably not the best thing to do as you say. I'd be hapy to look at the references you mention.<br>

</div>Thanks!<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 22, 2014 at 1:44 AM, Simon Wise <span dir="ltr"><<a href="mailto:simonzwise@gmail.com" target="_blank">simonzwise@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 22/05/14 02:01, Rafael Vega wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi.<br>
<br>
I'm developing an external that starts a separate pthread to poll some<br>
hardware inputs. When the outputs change, I need to send a message like [34<br>
56( to one of two outlets in the external from my thread.<br>
</blockquote>
<br></div>
from your previous emails I'd guess you are using a beagle board, I'm not sure what they provide as far as hardware interface goes, but on the Raspberries there is a library, and several usable APIs, that give access to the hardware interrupts from the GPIOs, either in many languages including C, python, bash etc so no need for polling, you can just use a call-back in C or even simpler start a call-back program in bash and pipe its (filtered) output to pd via pdsend.<br>


<br>
I can send some useful references to the Pi stuff if you are interested.<br>
<br>
It really is much better to avoid having polling loops and such in the CPU, hardware does this much better ... the GPIO drivers in the Pis offer callbacks, DMA and such to avoid this ... probably something similar is available on the beagleboard, otherwise that's the advantage of using something like an arduino ... the polling is then done in the arduino and only the relevant details are passed on to the main computer.<br>


<br>
A big operating system really isn't the right environment for the kind of timing required for low-level hardware interfaces.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Simon</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/<u></u>listinfo/pd-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div>Rafael Vega<br></div><a href="mailto:email.rafa@gmail.com" target="_blank">email.rafa@gmail.com</a></div>
</div>