找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1764|回复: 1
收起左侧

LCD1602滚动显示源程序

[复制链接]
ID:519606 发表于 2019-5-6 16:47 | 显示全部楼层 |阅读模式
#include<reg52.h>
typedef unsignedchar uint8;
typedef unsignedint uint16;
sbit rs=P2^6;
sbit rw=P2^5;
sbit e=P2^7;
uint8a[16]="perchin designed";
uint8b[27]="welcome to the world of mcu";
voiddelay(uint16 i)  //1us
{
      while(i--);
}
void wrc(uint8c)
{
      delay(1000);
      rs=0;
      rw=0;
      e=0;
      P0=c;
      e=1;
      delay(10);
      e=0;
      /*
      P0=c<<4;
      e=1;
      e=0;*/       //四位的LCD要加上
}
void wrd(uint8dat)
{
      delay(1000);
      rs=1;
      rw=0;
      e=0;
      P0=dat;
      e=1;
      delay(10);
      e=0;
      /*
      P0=dat<<4;
      e=1;
      e=0;*/     //四位的LCD要加上
      rs=0;   
}
void init()
{
      delay(1000);
      /*wrc(0x32);      
      wrc(0x28);
      wrc(0x28);   */   //四位的LCD要加上
      wrc(0x38);
      wrc(0x38);
      wrc(0x38);   
      wrc(0x0c);   
      wrc(0x01);   


LCD1602滚动显示.docx

11.4 KB, 下载次数: 19, 下载积分: 黑币 -5

评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

回复

使用道具 举报

ID:581782 发表于 2019-7-10 17:19 | 显示全部楼层
学习
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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