fix a couple typos in readme and example
This commit is contained in:
parent
ffd57942b0
commit
5634b40300
3 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
4
index.js
4
index.js
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue