fix a couple typos in readme and example

This commit is contained in:
Todd Treece 2016-05-19 11:07:34 -04:00
parent ffd57942b0
commit 5634b40300
3 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ mpr121.on('touch', (pin) => console.log(`pin ${pin} touched`));
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'}`);
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);

View file

@ -10,7 +10,7 @@ mpr121.on('touch', (pin) => console.log(`pin ${pin} touched`));
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'}`);
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);

View file

@ -43,7 +43,7 @@ const MPR121_I2CADDR_DEFAULT = 0x5A,
class MPR121 extends EventEmitter {
constructor(address, bus, irq, interval) [
constructor(address, bus, irq, interval) {
super();
@ -219,7 +219,7 @@ class MPR121 extends EventEmitter {
}
isTouched = function(pin) {
isTouched(pin) {
if(! ready) return false;
if(pin < 0 || pin >= 12) return false;