![]() Kpi = Keypad_Key_Click() // Store key code in kpi variableĬase 1: kpi = 49 break // 7-Cmp kpi with equivalent ASCII code of 7, break if equal Wait for key to be pressed and released Lcd_Out(1,1,"PRESS A KEY") // Write "PRESS A KEY" in the first row Lcd_Out(1,1,"KEYPAD INTERFACE") // Write "KEYPAD INTERFACE" in the first row sbit LCD_RS at LATB.B1 //SAME AS "sbit LCD_RS at RB1_bit " sbit LCD_RS at LATB1_bit //same as "sbit LCD_RS at RB1_bit " Sbit LCD_RS at RB1_bit // it can only access a pin not a port Functions, such as keypad_init, keypad_key_clicketc, simply needs to be defined in the program, and rest of the inner operations are performed by the mikroC compiler.Write the following code in mikroC to interface keypad with PIC MCU: /* KEYPAD INTERFACING WITH PIC16F877A */ These library routines, however, can be used with other sizes of keypad as well. ![]() Just like for LCD, MikroC also provides built-in library functions for a 4×4 Keypad. ![]() ![]() Key = Keypad_Key_Click() C-CODE FOR KEYPAD INTERFACING WITH PIC16F877A
0 Comments
Leave a Reply. |