| |
'***************************************************************************
'***************************************************************************
'BX-24-Serial LCD
'Description: This simple application demonstrates use of the ISLCD220
I2C/Serial
'LCD Module controlled by the BX-24 microcontroller. A message is displayed
'on the screen, which then scrolls right before looping to the original
screen.
'
'Created: 26/11/02 Revision: 1.1
'Written by: TR Control Solutions (Jamie Finnan)
'TR-004
'
'***************************************************************************
'***************************************************************************
dim icom3(1 to 50) as byte 'inwards buffer (not used)
dim ocom3(1 to 50) as byte 'outwards buffer
dim line1 as string*20 '20 character string text
dim line2 as string*20 '20 character string text
dim count as byte 'byte used for count loop
'***************************************************************************
sub main()
'Ensure that the string length in the BasicX Editors Options > Environment
toolbar is
'20 or more for this application. It can be set to a maximum of 64 characters
in a string
Do
line1 = "BX-24, GPM & Serial " 'First line of text.
line2 = " Application " 'Second line of text.
call openqueue(icom3,50) 'create input queue
call openqueue(ocom3,50) 'create output queue
call definecom3 (0,17,bx1000_1000) 'define coms port on pin 0 and 17
'defining 0 as a pin means it is not used.
call opencom(3,9600,icom3,ocom3) 'initialise coms port3
call putqueuestr(ocom3,chr(254) & chr(1)) 'clear the screen
delay (1.0)
call putqueuestr(ocom3,chr(254) & chr(128)) 'Command byte sent
call putqueuestr(ocom3, line1) 'send first line
call putqueuestr(ocom3,chr(254) & chr(192)) 'command byte
call putqueuestr(ocom3, line2) 'send second line
Delay (2.0) '2 second delay
count = 0 'Set count byte to 0
Do 'Start of a do-loop-until construct
count = count +1 'increment count file by 1 on each loop.
call putqueuestr(ocom3,chr(254) & chr(28)) 'command byte and scroll
right
delay (0.5) '0.5 second delay
loop until (count = 20) 'loop 20 times
Loop 'loop main program
end sub 'End of main sub and program
'***************************************************************************
'***************************************************************************
|