$regfile = "m8def.dat" : $crystal = 1000000
Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5
Config Lcd = 16 * 2 : Cursor Off : Cls
Ddrd = 0 : Portd = 3
Dim Ss As String * 255 , S As String * 16
Dim B As Byte , C As Byte , A As Byte
Dim F As Integer , Z As Word
Ss = "www.iranled.com"
Home : Lcd "COUNTER = " ; F ; " "
'===============================================================================?
Do
B = Len(ss)
If B < 17 Then :
For A = 16 To 1 Step -1
S = Mid(ss , A , 1 ) : Locate 2 , A : Lcd S
Gosub Get_sw
Next
Gosub Get_sw : Gosub Get_sw
For A = 1 To 16
Locate 2 , A : Lcd " "
Gosub Get_sw
Next
Gosub Get_sw : Gosub Get_sw
Else :
S = Left(ss , 16)
For A = 15 To 1 Step -1
Locate 2 , A : Lcd S
Gosub Get_sw
Next
C = B - 16
For A = 2 To C
S = Mid(ss , A , 16 ) : Locate 2 , 1 : Lcd S
Gosub Get_sw
Next
For A = 16 To 1 Step -1
S = Right(ss , A) : Locate 2 , 1 : Lcd S ; " "
Gosub Get_sw
Next
Locate 2 , 1 : Lcd " " : Gosub Get_sw : Gosub Get_sw
End If
Loop
'===============================================================================
Get_sw:
For Z = 0 To 10100
Debounce Pind.0 , 0 , Incr_f , Gosub
Debounce Pind.1 , 0 , Decr_f , Gosub
Next
Return
Incr_f:
Incr F : Home : Lcd "COUNTER = " ; F ; " "
Return
Decr_f:
Decr F : Home : Lcd "COUNTER = " ; F ; " "
Return