user8002: I have a problem with the Arduino Uno. 
I need to use a 4x3 keypad and 16x2 LCD together with an Arduino Uno. As 4x3 keypad requires 7 pins, I have defined pins 2, 3, 4, 5, 6, 7 and 8 to it. A 16x2 LCD requires 6 pins but only 5 pins remain (9, 10, 11, 12 and 13). Pins 0 and 1 are used for serial. 
Please suggest a probable solution.

user6936: You could use a shift register to read the switches as outlined by the excellent tutorial Parallel to Serial Shifting-In with a CD4021BE. Quoting the summary:

Sometimes you'll end up needing more digital input than the 13 pins on
  your Arduino board can readily handle. Using a parallel to serial
  shift register allows you collect information from 8 or more switches
  while only using 3 of the pins on your Arduino.

So you would only use 3 pins to read the seven switches, which would leave you with 9 pins to play with, for the LCD.
In addition, you could use a similar method for the LCD, using a shift-out register, and use just 3 pins for the 6 inputs of the LCD. A tutorial for that is Alphanumeric LCD with Shift Register on Arduino – part 1, using the AlphaLCD library or 3-Wire Serial LCD using a Shift Register, which has no library, but provides code. 
This would leave you with 6 pins free (out of the total 12 pins, if you exclude pins 0 and 1 for serial), after both the switches and LCD are wired up.
Of course, this solution requires you to purchase one or two shift (in and/or out) registers.
The Arduino IDE may come with a built-in library that use shift registers, but I am not sure about that. Maybe someone can confirm, or refute, this?
I hope that this helps.

8002: <p>I have a problem with the Arduino Uno. </p>

<p>I need to use a 4x3 keypad and 16x2 LCD together with an Arduino Uno. As 4x3 keypad requires 7 pins, I have defined pins 2, 3, 4, 5, 6, 7 and 8 to it. A 16x2 LCD requires 6 pins but only 5 pins remain (9, 10, 11, 12 and 13). Pins 0 and 1 are used for serial. </p>

<p>Please suggest a probable solution.</p>
 6936: <p>You could use a shift register to read the switches as outlined by the excellent tutorial <a href="http://www.arduino.cc/en/Tutorial/ShiftIn" rel="nofollow">Parallel to Serial Shifting-In with a CD4021BE</a>. Quoting the summary:</p>

<blockquote>
  <p>Sometimes you'll end up needing more digital input than the 13 pins on
  your Arduino board can readily handle. Using a parallel to serial
  shift register allows you collect information from 8 or more switches
  while only using 3 of the pins on your Arduino.</p>
</blockquote>

<p>So you would only use 3 pins to read the seven switches, which would leave you with 9 pins to play with, for the LCD.</p>

<p>In addition, you could use a similar method for the LCD, using a shift-out register, and use just 3 pins for the 6 inputs of the LCD. A tutorial for that is <a href="http://www.electroschematics.com/11155/alphanumeric-lcd-shift-register-arduino-part-1/" rel="nofollow">Alphanumeric LCD with Shift Register on Arduino – part 1</a>, using the <a href="http://www.electroschematics.com/wp-content/uploads/2015/01/AlphaLCD.zip" rel="nofollow">AlphaLCD library</a> or <a href="http://www.electronics-lab.com/projects/mcu/015/" rel="nofollow">3-Wire Serial LCD using a Shift Register</a>, which has no library, but provides code. </p>

<p>This would leave you with 6 pins free (out of the total 12 pins, if you exclude pins 0 and 1 for serial), after both the switches and LCD are wired up.</p>

<p>Of course, this solution requires you to purchase one or two shift (in and/or out) registers.</p>

<p>The Arduino IDE may come with a built-in library that use shift registers, but I am not sure about that. Maybe someone can confirm, or refute, this?</p>

<p>I hope that this helps.</p>
