I’m new with the Photon and Particle environment.
I want to connect my MPR121 Capacitive Keypad to my Photon via I2C communication. But I can’t find out how I initialize and setup it in my software.
I’m nether sure about the hardware setup. I know SDA -> D0 and SCL -> D1, but not sure with IRQ -> # ?
Hope someone can help me witht this setup. I want the opportunity to touch an passcode on the keypad, and get it into my code.
I am using the MPR121 breakout (no keypad) but as for the IRQ you can choose any Digital Pin.
I am using a modified Adafruit MPR121 lib like this (i don’t use interrupt functionality at all so far though)
int irqpin = D5; // Touch IRQ. Might be useful for ECO-Mode
Adafruit_MPR121 cap = Adafruit_MPR121();
void initMPR() {
pinMode(irqpin, INPUT);
digitalWrite(irqpin, HIGH);
Wire.begin();
if (!cap.begin(0x5A)) {
//MPR121 Not Ready?
Serial.println("MPR121 Not Ready");
}
If this code came from an Arduino library this would cause the AVR chip to attach a pull-up resistor to the interrupt pin, but on the Particles you’d rather just write
pinMode(irqpin, INPUT_PULLUP);
The other version would not work the same way.
@eskehagen, have you got a link to a library that would support that keypad on another platform (e.g. Arduino)?
Hi @eskehagen Check out the below link i have used it with particle photon and is working perfect.The below link has all the details and code for getting the mpr121 work.
That’s very odd.
How have you cleared the cache?
Have you done it via the gear icon (bottom left of Build) and the CLEAR CACHE button?
Maybe clear the cache again, log out of Build, close your browser re open it in incognito mode (if possible) and the log in again.
I’ve tried this with an other account and I found the lib in the public list.
Hmm! Maybe I was not clear enough
When I said search for “MPR121” I meant this as a short and easy search term, but actually the library I “ported” is exactly this “Adafruit_MPR121” library