i try display ASCII character on 2x16 LCD display received from ps2 keyboard.but this code is not work.anybody please help me.
Code: Select all
//-------------------------------------------------------------------------------
char *text = "KEY BORD TEST";
unsigned short keydata, special, down, temp;
void main()
{
TRISC = 0; // PORTB is output
Lcd_Custom_Config(&PORTC,3,2,1,0,&PORTC,4,6,5); // Initialize LCD on PORTB
Lcd_Custom_Cmd(Lcd_CURSOR_OFF); // Turn off cursor
Lcd_Custom_Out(1, 1, text); // Print text at LCD
Ps2_Config(&PORTB, 2, 3);
Delay_ms(100);
while (1)
{
if (Ps2_Key_Read(&keydata, &special, &down))
{
temp = (keydata) ;
Lcd_Custom_Out(2, 1, temp); // Print text at LCD
Delay_ms(10); // debounce
delay_ms(2000);
}
}
}
//----------------------------------------------------------------