Skip to content

Commit

Permalink
lib: Use abandonware i2c module
Browse files Browse the repository at this point in the history
Fullback to regular i2c (for IoT.js)

Previously I used this hack:

NODE_PATH=node_modules/@abandonware node ...

Relate-to: kelly/node-i2c#97
Change-Id: I3dd4d8d6f27924ec004be1b9fac8f5499eff2d1f
Signed-off-by: Philippe Coval <[email protected]>
  • Loading branch information
rzr committed Jan 13, 2020
1 parent 25106e9 commit 6abda12
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bmp085-sensor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
var async = require('async');
var i2c = require('i2c');
var i2c = null;

try {
i2c = require('@abandonware/i2c');
} catch(err) {
i2c = require('i2c');
}

module.exports = function BMP085(options) {
var sensor = function() {};
Expand Down

0 comments on commit 6abda12

Please sign in to comment.