找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 867|回复: 0
收起左侧

lcd shift text from top to bottom

[复制链接]
ID:805239 发表于 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

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表