No description
Find a file
robmckinnon 37c063d409 Upgrade i2c-bus to ^4.0.2
Attempt to fix this error:

TypeError: domain.enter is not a function
    at topLevelDomainCallback (domain.js:101:12)
2018-09-30 11:22:06 +01:00
.gitignore add gitignore 2016-05-19 10:42:50 -04:00
example.js fix a couple typos in readme and example 2016-05-19 11:07:34 -04:00
index.js remove irq 2016-05-19 13:31:31 -04:00
LICENSE add readme and license info 2016-05-19 10:40:32 -04:00
package.json Upgrade i2c-bus to ^4.0.2 2018-09-30 11:22:06 +01:00
README.md update npm package name to adafruit-mpr121 2016-06-07 19:59:40 -04:00

MPR121 Library for Node.js

Access a MPR121 breakout using Node.js from a Raspberry Pi or BeagleBone Black.

Installation

This library requires Node.js v6.0.0 or higher.

$ npm install adafruit-mpr121

Example

const MPR121 = require('adafruit-mpr121'),
      mpr121  = new MPR121(0x5A, 1);

// listen for touch events
mpr121.on('touch', (pin) => console.log(`pin ${pin} touched`));

// listen for release events
mpr121.on('release', (pin) => console.log(`pin ${pin} released`));

// listen for changes to the state of a specific pin
mpr121.on(3, (state) => console.log(`pin 3 is ${state ? 'touched' : 'released'}`));

// check the current state of a specific pin synchronously
const state = mpr121.isTouched(2);
console.log(`pin 2 is ${state ? 'touched' : 'released'}`);

License

Copyright (c) 2016 Adafruit Industries. Licensed under the MIT license.