// ******************************************************************************************* // #include "p24fj64ga002.h" #include "keypad.h" // ******************************************************************************************* // void KeypadInitialize() { // TODO: Configure IOs and Change Notificaiton interrupt for keypad scanning. This // configuration should ensure that if any key is pressed, a change notification interrupt // will be generated. } // ******************************************************************************************* // char KeypadScan() { char key = -1; // TODO: Implement the keypad scanning procedure to detect if exactly one button of the // keypad is pressed. The function should return: // // 0 : Return 0 if no keys are pressed. // '0' - '9' : Return the ASCII character '0' to '9' if one of the // numeric (0 - 9) keys are pressed. // '+' : Return the ASCII character '+' if the A key is pressed. // '-' : Return the ASCII character '-' if the B key is pressed. // '*' : Return the ASCII character '*' if the C key is pressed. // '/' : Return the ASCII character '/' if the D key is pressed. // -1 : Return -1 if the * or # keys are pressed, or if more than // one key is pressed simultaneously. return key; } // ******************************************************************************************* //