lcd shift text from top to bottom
_______________________________________
$regfile = "m8def.dat"
$crystal = 1000000
$baud = 9600
$hwstack = 40
$swstack = 16
$framesize = 32
Dim Txt As String * 20
Dim Txt_1 As String * 20
Dim Time_txt As Word
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim E As Byte
Config Lcd = 16x2
Config Lcdpin = Pin, Db4 = Portb.3, Db5 = Portb.2, _
Db6 = Portb.1, Db7 = Portb. 0, E = Portb.4, Rs = Portb.5
Cursor Off
Cls
Input "SEND TXT:", Txt
Input "SEND TIME(MS):", Time_txt
Print
Print
Print "# ####### #"
Print "# # # # #"
Print "# # # # #"
Print "##### # ### ######"
Print "# # # # # # #"
Print "# # ### ### # #"
A = Len(txt)
C = 17-A
Do
For B = 1 To 17
Cls
Locate 1, B
Lcd Txt
If B> C Then
E = BC
Txt_1 = Right(txt, E)
Locate 2, 1
Lcd Txt_1
End If
Waitms Time_txt
Next
For B = 1 To 17
Cls
Locate 2, B
Lcd Txt
If B>C Then
E = BC
Txt_1 = Right(txt, E)
Locate 1, 1
Lcd Txt_1
End If
Waitms Time_txt
Next
Loop
End
_______________________________________
enjoy it
|