If you have a new amazing Acme Systems Aria board or a FoxBoad G20, you can easy manage GPIO using Node.js and my last aria_fox_gpio node module and also the daisy_gpio to manage Daisy board for fast prototyping. The aria_fox_gpio package is a full asynchronous module that handle all GPIO using hardware interrupt to notify all GPIO changes without waste your cpu. To debounce your input you can define a debounce time to avoid incorrect reports of change of state.
Let’s see how.

First you must install Node.js on your board following this instructions (tested with v0.8.14). Now you can install daisy_gpio as usual:

Done! Now you can write a simple program to turn on a led when push a button using two prototype boards: Daisy5 and Daisy11. Assuming you connect Daisy5 to D5 connector and Daisy11 to D2 connector of your FoxBoard, your first program seems like this:

Save your file as presstolight.js and run in your terminal:

Now if you push a button, the corresponding led is turned on. Easy, right? Note that the init and free events are fired only when ALL leds (buttons) of Daisy11 (Daisy5) are ready to use and available respectively, whereas the rising and falling events are fired by every led (button). Note also that all events have a data property that contains two properties:

  • err: the error if occurred
  • sender: the Gpio instance that has fired the event

The for a change event has also a value property with the last value.

In general if you want manage your GPIO as input or output without a daisy prototype board, you can use the generic aria_fox_gpio module. Install it:

and write a simple program:

Save your file as blinking.js and run in your terminal:

Your led is blinking.

See full documentation online or into doc folder and some examples into test folder within the aria_fox_gpio package and daisy_gpio package.

UPDATE: Now the module works both with Linux kernel 2.6.39 and 3.11.6.


About Marcello Gesmundo

I'm the founder of Yoovant company. I'm an engineer and an artist: what could be better than combine the technologies with the arts?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">