Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
371
Keypad Library
mikroBasic 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  defined  in  all  projects 
using Keypad Library:
Description: Example:
dim keypadPort as word sfr external
Keypad Port.
dim keypadPort as word at PORTB
dim keypadPort_Direction as word sfr external
Keypad Port.
dim  keypadPort_Direction  as  word  at 
TRISB
 
Library Routines
 
- Keypad_Init 
 
- Keypad_Key_Press 
 
- Keypad_Key_Click 
Keypad_Init
Prototype
sub procedure Keypad_Init()
Description Initializes given port for working with keypad.
Parameters None.
Returns
Nothing.
Requires
Global variable: 
keypadPort
 - Keypad port 
must be defined before using this function. 
Example
‘ Keypad module connections
dim keypadPort as word at PORTB
dim keypadPort_Direction as word at TRISB
‘ End Keypad module connections
...
Keypad_Init()
Notes
The Keypad library uses lower byte (bits <7..0>) of 
keypadPort
.