Module for the MPR121 12-Channel Capacitive Sensor (I2C)
Use the MPR121 (About Modules) module for reading which of the MPR121's 12 electrodes are touched
This module communicates with the chip over I2C.
Basic usage:
I2C1.setup({scl:B6,sda:B7});
function ready() {
setTimeout(function() {
var keys = mpr.touched();
console.log("Touched: " + keys);
}, 200);
}
var mpr = require("MPR121").connect(I2C1, ready);
// or
var mpr = require("MPR121").connect(I2C1, ready, { address: 0x5B });
MPR121 module functions
touched() - gives back a 12bit number where each high bit is an activated electrode/key
setThresholds() - sets the press/release treshold values
write() - writes the provided data (array) to the i2c bus
read() - reads the given number of bytes from the i2c bus
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.