keyblcd.h

This example reads key from PS/2 Kerboard and displays the key on the LCD16x2. (by Julio Cesar Silva Briano).



/***********************************************************************/
/* PORT configuration                                                  */
/***********************************************************************/
/*                                                                     */
#define PortAConfig  00010000b   //  1=input
#define PortBConfig  00000001b   //  1=input                                

/***********************************************************************/
/* OPTION REG and INTCON configuration                                 */
/***********************************************************************/
/*                                                                     */
#define  CFG_OPTION 10000000b
#define  CFG_INTCON 10010000b

//*************************
//        General
//*************************
#define FALSE    0
#define TRUE     1
#define START    1
#define PARITY  10
#define STOP    11

//**************************
// Global Variables
//**************************
char intc;
char keyIn;
char pinIn;
char statusParity;
char newByte;
char indexBuffer;
char realKey;

char counter3;
char charCounter=0;

//---  For Decode Key
char isUp=0;
char shift=0;
char mode=0;
//-------------------

//**************************
//   Function prototipes
//**************************
void tmrHandler( void );
void inteHandler( void );
void interrupt( void );
void decode(void);



http://www.sourceboost.com/home.html

Copyright © 2002-2006 SourceBoost Technologies