Microcontroller › PIC › what is wrong with my code , i wanna save the pressed key from Keypad to an array › char keypadPort at PORTd;//
char keypadPort at PORTd;
// Start LCD module connections
sbit LCD_RS at Rb0_bit;
sbit LCD_EN at Rb1_bit;
sbit LCD_D4 at Rb4_bit;
sbit LCD_D5 at Rb5_bit;
sbit LCD_D6 at Rb6_bit;
sbit LCD_D7 at Rb7_bit;
sbit LCD_RS_Direction at TRISb0_bit;
sbit LCD_EN_Direction at TRISb1_bit;
sbit LCD_D4_Direction at TRISb4_bit;
sbit LCD_D5_Direction at TRISb5_bit;
sbit LCD_D6_Direction at TRISb6_bit;
sbit LCD_D7_Direction at TRISb7_bit;
// End LCD module connections
int x,i;
char fromuser[4];
int kb;
void main()
{
adcon1=7;
lcd_init();
keypad_init();
lcd_out(1,1,”welcome”);
delay_ms(2000);
lcd_cmd(1);
do{
i=0;
kb=keypad_key_press();
fromuser=kb;
i++;
}while(kb!=4);
for(x=0;x<4;x++){lcd_chr(1,x+1,fromuser[x]+48);}
}//end main