User manual
mikroC PRO for dsPIC
MikroElektronika
395
Keypad Library
The mikroC PRO for dsPIC30/33 and PIC24 provides a library for working with 4x4 keypad. The library routines can
also be used with 4x1, 4x2, or 4x3 keypad. For connections explanation see schematic at the bottom of this page.
External dependencies of Keypad Library
The following variable must be
dened in all projects using Keypad
Library:
Description : Example :
extern sfr unsigned int
keypadPort;
Keypad Port.
unsigned keypadPort at PORTB;
Library Routines
- Keypad_Init
- Keypad_Key_Press
- Keypad_Key_Click
Keypad_Init
Prototype
void Keypad_Init();
Description Initializes given port for working with keypad.
Parameters None.
Returns Nothing.
Requires Global variable :
- keypadPort - Keypad port
must be dened before using this function.
Example
// Keypad module connections
char unsigned at PORTB;
// End of keypad module connections
...
Keypad_Init();
Notes The Keypad library uses lower byte (bits <7..0>) of keypadPort.