User manual
314
mikoPascal PRO for PIC32
MikroElektronika
Keypad Library
mikroPascal PRO for PIC32 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:
var keypadPort : word; sfr;
external;
Keypad Port.
var keypadPort : byte at PORTB;
var keypadPort_Direction : word;
sfr; external;
Keypad Port.
var keypadPort_Direction : byte at
TRISB;
Library Routines
- Keypad_Init
- Keypad_Key_Press
- Keypad_Key_Click
Keypad_Init
Prototype
procedure 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
var keypadPort : byte at PORTB;
var keypadPort_Direction : byte at TRISB;
// End of keypad module connections
...
Keypad_Init();
Notes The Keypad library uses lower byte (bits <7..0>) of keypadPort.