Git Product home page Git Product logo

node-mcp23017's People

Contributors

askanhesse avatar felixfuchs17 avatar jopiek avatar jsyang avatar kaihenzler avatar nleclerc avatar soundstorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-mcp23017's Issues

Examples

Hi, I'm just having a go with the example javascript and wondered if the line:

var MCP23017 = require('mcp23017');

Is actually supposed to be require('node-mcp23017') ?
It would explain the problem I've been having of it not finding the module named 'mcp23017'

Error while compilation

Hi,
i'm getting an error at compilation with > node-gyp rebuild

Can you help ?

i2c.target.mk:90: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/home/pi/nodeserver/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.50-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/nodeserver/node_modules/i2c
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/nodeserver/package.json'
npm WARN nodeserver No description
npm WARN nodeserver No repository field.
npm WARN nodeserver No README data
npm WARN nodeserver No license field.
npm ERR! Linux 4.4.50-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-mcp23017" "--save"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the i2c package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs i2c
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls i2c
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/nodeserver/npm-debug.log

npm-debug.log.txt

Broken Reference in Version 0.0.3

Unfortunately, it seems that a variable is no longer defined, because everything still works in version 0.0.2.
I get the following error:

/node_modules/node-mcp23017/lib/mcp23017.js:136
this._send(register, [registerDir]);

I am using node 8.11.1
The operating system is the latest version of RASPBIAN STRETCH.

Would you mind me porting this to ES6?

Hi,

First of all, thank you for writing this module.
I was wondering if you'd be happy for me to port this to ES6 (mainly using const and native classes). This will make the code more modern and easier to maintain in the longer term.

Please let me know if you'd accept a PR for it.

Merc.

Update examples

Hi there, thanks for the work on this library, I think there have been some changes to the API that we find in the readme which need to be changed to reflect the new one:

var mcp = new MCP23017({
  address: 0x20, //default: 0x20
  device: '/dev/i2c-1', // '/dev/i2c-1' on model B | '/dev/i2c-0' on model A
  debug: true //default: false
});

should be

var mcp = new MCP23017({
  address: 0x20, //default: 0x20
  device: 1, // 1 for '/dev/i2c-1' on model B | 0 for '/dev/i2c-0' on model A ////// this field accepts only numbers now in i2c-bus
  debug: true //default: false
});

and

mcp.digitalRead(0, function (err, value) {
  console.log('Pin 0', value);
});

should be

/////// There is the addition of a new first argument for .prototype.digitalRead()
mcp.digitalRead(0, function (pin, err, value) {
  console.log('Pin 0', value);
});

I'm happy to submit a PR for this if this sounds good to you. Thanks again for sharing this!

Alert events

Hello people.
i've a number of sensors (like HC-SR04), i'm trying put them under a mcp23017 so i can use them in parallel.
The original code used pigpio
https://github.com/fivdi/pigpio/blob/master/doc/gpio.md#event-alert

Especially i need to use "Gpio.INPUT, alert: true" and the "on alert" event ( .on('alert', (level, tick) => {})
to send a pulse via a channel and see the time to calculate distance.
I know node-mcp23017 uses i2c-bus. So, is there a way to substitute the alert event with the bus.receiveByte(addr, cb) function?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.