3x4 keypads have to be connected to 7 lines ..
With 4 lines you can be connected to 2 columns and 2 rows and that means 4 switches ..
If your microcontroller has Analog-to-Digital converter, say, 8-bit you can use it for scanning a keypad of theoretically up to 256 keys ..
In this article you will find more details on how to do it: **broken link removed**