Hi Simon, 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. Thanks!
On Thu, May 22, 2014 at 1:44 AM, Simon Wise simonzwise@gmail.com wrote:
On 22/05/14 02:01, Rafael Vega wrote:
Hi.
I'm developing an external that starts a separate pthread to poll some hardware inputs. When the outputs change, I need to send a message like [34 56( to one of two outlets in the external from my thread.
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.
I can send some useful references to the Pi stuff if you are interested.
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.
A big operating system really isn't the right environment for the kind of timing required for low-level hardware interfaces.
Simon
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list