rwaldron / nino-io

Linino One & Arduino Yun IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
8 stars 2 forks source link

i2c support #3

Closed fivdi closed 9 years ago

fivdi commented 9 years ago

Here's a PR for I2C support in Nino-IO.

Linino OS doesn't come with g++ pre-installed, so i2c-bus v0.11.1 was cross-compiled and the binaries have been added to Nino-IO. The binaries are for the Linux OS, the MIPS architecture, and node.js v0.10.25. There's a postinstall script called install-i2c-bus.js for installing the binaries. In order for the postinstall script to run successfully, Nino-IO must be installed as follows:

npm install nino-io --unsafe-perm

The strange looking require in nino-io.js is there to enable tests to be run successfully on a development machine. Without the try/catch an error will be thrown on the development machine as i2c-bus isn't actually installed on the development machine.

var i2c;
try {
  i2c = require("i2c-bus");
} catch (ignore) {
}
fivdi commented 9 years ago

:+1: