Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

How to input array elements using keypad ??

3 posts / 0 new
Last post
Ahmed's picture
Last seen: 11 months 3 weeks ago
Joined: 31/05/2018 - 08:14
How to input array elements using keypad ??

I want to display array elements of LCD by using Keypad. I made a for loop to store every element and display it but ONLY the FIRST element is displayed many times as the size of for loop .. the code is 

int val[4] ;

for(i = 0; i<5 ; i++)
                    val [ i ] = KeyPad_getPressedKey();
                    LCD_intgerToString ( val [ i ] ) ;


when I simulate it on protues only the FIRST ELEMENTS displayed five times ..
How can I fix this problem ??

Ashutosh Bhatt
Ashutosh Bhatt's picture
Last seen: 2 months 2 weeks ago
Joined: 21/12/2010 - 15:59
why are you using for loop

why are you using for loop?

you should use while loop

you pole your keypad in while loop and when button is pressed display it on LCD