User`s manual

mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
mikroBasic provides a set of library procedures and functions for communicating
with commonly used LCD (4-bit interface) (LCD with the controller Hitachi
HD44780). HW connection of PIC and LCD is shown in the following figure.
Be sure to designate port with LCD as output, before using any of the following
library procedures or functions.
sub procedure LCD_Init(dim byref PORT as byte)
Initializes LCD at port PORT.
sub procedure LCD_Out(dim byref PORT as byte, dim Row as byte,
dim Column as byte, dim byref text as char[255])
Prints text (string variable) at specified row and column on LCD; only string vari-
ables can be passed, constants cannot.
sub procedure Lcd_Chr(dim byref port as byte, dim Row as byte,
dim Column as byte, dim Out_Char as byte)
Prints Out_Char at specified row and column on LCD.
sub procedure Lcd_Cmd(dim byref port as byte, dim Out_Char as byte)
Sends command Out_Char.
For example:
Lcd_init(PORTB)
' initializes LCD on PORTB (4-bit interface)
LCD_out(PORTB,1,1,a)
' prints string variable a on LCD (1st row, 1st column)
LCD_Char(PORTD,1,1,'e'))
' prints character (e) on LCD (1st row, 1st column)
LCD_Cmd(PORTD,Lcd_Clear)
' sends command LCd_Clear to LCD (clears Lcd display)
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
145
page
LCD Library
Note
Routines