Making a calculator using an Arduino

I agree with both of you. I may add a debounce, but I wonder how and where to place the tiny delay ? The key data came from the 4021, after a shiftIn() read. And the interrupt signal came from a 4 input NAND gate - 74LS20. So any bouncing by a key, also created a double pulse at the interrupt pin, activate the interrupt request. A 555 in monostable mode will take care of that. I will re-design the keypad circuit and is not done yet. I may add a latch in between the inverters and the 4021. And beside the bouncing problem, the close contact is not a close contact after all, more than intermittent, due to a non - proper LOW level at the input gates. The LM339 comparator will take care of that. I will set the comparator V ref at 2.5 V <-- mid point. Still two state.

I will keep you guys posted.

I happen to have a PS/2 keypad - see picture. I will re-code using the PS/2 library and re-do a circuit to use the PS/2 keypad and using the same 7 segments display. I will do that later. I will keep you posted on that one too. Still keep the same tread anyway.