Adafruit 1x4 Membrane Keypad Help

Would this not connect all the buttons together???
Every button connected to an interrupt pin via a diode for each button may just work better.
Cheers Bob

1 Like

All buttons linked to the interrupt pin then each individual button connected to its own GPIO pin.

One problem I realised was that I didn’t define pin mode for my interrupt pin. Now it does this:

Same but different

I’m wondering if debouncing is part of the issue.

Read my reply.
It looks like you have all the buttons connected together to the interrupt pin. The code would read all the buttons as pressed no matter which one was operated.
Difficult to comment further without a circuit showing what you have done.
Cheers Bob

1 Like

Yes the buttons are all wired to a single interrupt pin so that they will all trigger the interrupt however at the same time button one is wired to its own pin on say pin 4. Button two would then be wired to pin 5 and so on. The interrupt will read the states of all the pins and the main body compares interrupt state to pin 4 etc. Well that’s the idea anyway.

Circuit setup is pretty simple and I’m not worried about the wiring (triple checked today). Earlier on the basic setup that didn’t use interrupts worked but obviously not suitable in the end.

Cheers

Jake

1 Like

Read my previous reply again!!! PLEASE. Read all of them.

If what you say is correct you have effectively connected all the buttons together and it won’t matter what button you press all will register.

You need to wire the buttons back to the interrupt pin via diodes. 1N4148 will do or if the 0.6V drop in the diodes is a problem you will need schottky diodes with a smaller forward voltage drop.

Polarity of the diodes will depend on what you are doing with the buttons. Pull ups and grounding to activate or supplying voltage to activate.

The diodes keep the buttons isolated from each other as far as the I/O pins are concerned.

Cheers and good luck this time around. Bob

2 Likes

Yes - sorry, slipped my mind at the time but you’re on the money Bob!

A 74 series TTL IC would also work, such as 7421/22/23. They are easily salvaged from old equipment and wiring would be no more difficult than diodes.

2 Likes

I see what you mean Bob. Thanks for the help. Explains what I’m seeing now. I’ll throw in the diodes and see what happens.

Cheers

Jake

1 Like

You are kidding right???
For a start you would have to power it.
Diodes require no power, just connect them.
Only cost a few cents. Not worth the salvage effort and the uncertainty of second hand parts. No contest.
Cheers Bob

Throw them in with the correct polarity or the won’t work.
Cheers Bob

2 Likes

Of course

Cheers

Jake

1 Like

Ahh I see where you’re going with the logic gates. Interesting idea, there’s more than one way to skin a cat!

1 Like