找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 1113|回復: 0
收起左側(cè)

lcd shift text from top to bottom

[復制鏈接]
ID:805239 發(fā)表于 2020-7-18 20:51 | 顯示全部樓層 |閱讀模式
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

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復 返回頂部 返回列表