If you get one/more "Error exporting pin" errors, you wont be able to use those pins. Either try running again, or try rebooting your omega (remembering to re-mount the USB after reboot).

I also have trouble getting pin 8 to do anything (it crashes the program because it can't set the direction), although using fast-gpio works fine. This seems to be a bug with the GPIO exporter, not the wrapper. I also don't seem to be able to do anything with pin 13 — no error, but nothing happens, even with fast-gpio. This one might be a hardware issue or manufacturing defect...

And finally a sample. This assumes you've wired up an LED to pin 14 (eg. pin 14 > 330ohm resister > long leg of LED > short leg of LED > GND). Just download gpiohelper.js from the GitHub URL above and put it in the same folder as your JS.

var GPIOHelper = require('./gpiohelper');
var helper = new GPIOHelper();
var ledPin = 14;
// The state of our light. False for off, true for on.
var lightState = false;
// Every 1000 miliseconds...
setInterval(function() {
// Toggle the lightState variable. If it was true it will now be false, and vice versa.
lightState = !lightState;
// FInally, set the light as either on or off depending on lightState
helper.setPinSync(ledPin, lightState);
}, 1000);

@Christopher-Hiller Node-gyp is a tough thing to get working on the Omega :( I don't think the Omega has enough resources to do the compilation. One idea we've had was to pre-cross-compile some of the popular Node.js modules that require compilation and put the binaries up in a separate npm repository.

I like the idea of have a pre compiled library of modules instead of compiling them, but... It puts the onus on someone to make the ones that someone wants and maintain them though. Wouldn't version differences get messy?

@Chris-Ward Yeah, there are definitely a lot of intricacies involved. But instead of managing the versions entirely through directories and file naming conventions, we might be able to use a git server to do it. npm can install modules directly from a git repository.

@Boken-Lin Just wanted to point out that the gentleman who actually created the cross-compilation toolchain I wrapped in a docker container has a script (that I not so coincidentally left in there) that should also cross-compile npm.

From there, you could define the manifests for nom packages to definitely pull pre-cross-compiled binaries. . .