Hi Patrick,
Hope this helps. It is ment to work with a 16 digit display.
Code:
' Variable definition
CounterA var byte
CounterB var byte
CounterC var byte
DataA var byte
' String to be displayed
' 1 2 3 4
' 12345678901234567890123456789012345678901234
Data "Olympic Timer Powered by MeLabs PICBasic Pro" 'length = 44 charaters
' Start program
BANNER:
lcdout $FE, 1 'Clear LCD
pause 1000 'Time to initialise LCD
' This loop displays the first 16 characters of the string during 1 second = "Olympic Timer Po"
for countera = 0 to 15 'Setup a counter for 16 steps
read Countera, dataa 'Goto to memory location and read the character of the string
LCDOut DataA 'Display the current character
next
pause 1000 'Pause the first 16 characters to make them visible
' These two following loops make the text shift effect for 28 times (string is 44 character - 16 first characters already displayed = 28 characters to go)
' When CounterA is 0, we will display "lympic Timer Pow"
' When CounterA is 1, we will display "ympic Timer Powe"
' When CounterA is 2, we will display "mpic Timer Power"
' ....
For CounterA = 0 to 28 'This loop will shift the text for 28 times (44 - 16 = 28)
CounterC = CounterA + 15 'CounterC indicates the position of the first next character to be displayed
LCDOut $FE, $80 'Set the cursor Home (you can try "LCDOUT $FE, 1" or "LCDOUT $FE, 2" too)
' This loop reads the 16 characters to be displayed at that time
For CounterB = CounterA to CounterC 'CounterB will read 16 characters starting at character position "CounterC"
Read CounterB, DataA 'Goto to memory location and read the character of the string
LCDOut DataA 'Display the current character
Next
Pause 200 'Speed of display shift
Next
Pause 1000 'Keep the last 16 characters of the text ON during 1 second before restart
goto BANNER
end
Bookmarks