remove check device method
This commit is contained in:
parent
6aede848b2
commit
7b238e67f0
1 changed files with 1 additions and 17 deletions
18
index.js
18
index.js
|
|
@ -92,8 +92,7 @@ class MPR121 extends EventEmitter {
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
|
|
||||||
return this.checkDevice()
|
return this.setThresholds(12, 6)
|
||||||
.then(() => this.setThresholds(12, 6))
|
|
||||||
.then(() => this.writeByte(MPR121_MHDR, 0x01))
|
.then(() => this.writeByte(MPR121_MHDR, 0x01))
|
||||||
.then(() => this.writeByte(MPR121_NHDR, 0x01))
|
.then(() => this.writeByte(MPR121_NHDR, 0x01))
|
||||||
.then(() => this.writeByte(MPR121_NCLR, 0x0E))
|
.then(() => this.writeByte(MPR121_NCLR, 0x0E))
|
||||||
|
|
@ -116,21 +115,6 @@ class MPR121 extends EventEmitter {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDevice() {
|
|
||||||
|
|
||||||
return this.readByte(MPR121_CONFIG2)
|
|
||||||
.then((c) => {
|
|
||||||
|
|
||||||
// TODO figure out why this fails on ras pi
|
|
||||||
// if(c != 0x24)
|
|
||||||
// return Promise.reject(`MPR121 notfound. Check address, bus and wiring. (${c} != 36)`);
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setThresholds(touch, release) {
|
setThresholds(touch, release) {
|
||||||
|
|
||||||
if(touch < 0 || touch > 255) return Promise.reject();
|
if(touch < 0 || touch > 255) return Promise.reject();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue