darrylhodgins / piface-node

Node.js addon for Raspberry Pi & Piface
MIT License
24 stars 11 forks source link

Emit events directly from c++ code? #3

Open darrylhodgins opened 10 years ago

darrylhodgins commented 10 years ago

Investigate whether it's possible for the C++ code to directly emit events.

h0ru5 commented 9 years ago

I am not familiar with NAN, how to emit an event from there, or to pass in a js callback that emits the event

However, this seems quite handy for avoiding the active loop: https://github.com/piface/libpifacedigital/blob/master/src/pifacedigital.h#L212