Datasheet
Keypad_Init
300
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void Keypad_Init(void);
Returns Nothing.
Description Initializes port for working with keypad.
Requires
Global variables :
keypadPort - Keypad port
keypadPort_Direction - Direction of the Keypad port
must be defined before using this function.
Example
// Initialize PORTB for communication with keypad
sfr char keypadPort at PORTB;
// Port direction
sfr char keypadPort_Direction at DDRB;
// LCD module connections
sbit LCD_RS at PORTD.B2;
sbit LCD_EN at PORTD.B3;
sbit LCD_D4 at PORTD.B4;
sbit LCD_D5 at PORTD.B5;
sbit LCD_D6 at PORTD.B6;
sbit LCD_D7 at PORTD.B7;
sbit LCD_RS_Direction at DDRD.B2;
sbit LCD_EN_Direction at DDRD.B3;
sbit LCD_D4_Direction at DDRD.B4;
sbit LCD_D5_Direction at DDRD.B5;
sbit LCD_D6_Direction at DDRD.B6;
sbit LCD_D7_Direction at DDRD.B7;
// End LCD module connections
...
Keypad_Init();