没有合适的资源?快使用搜索试试~ 我知道了~
1602液晶的程序,对于初学者来说很不错
资源推荐
资源详情
资源评论
![application/x-dosexec](https://img-home.csdnimg.cn/images/20210720083343.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit lcdrs=P1^0;
sbit lcden=P1^2;
sbit lcdwr=P1^1;
uchar CGCODE[]={0x08,0x0F,0x12,0x0F,0x0A,0x1F,0x02,0x02,//"年"代码 0x00
0x0F,0x09,0x0F,0x09,0x0F,0x09,0x13,0x00,//"月"代码 0x01
0x0F,0x09,0x09,0x0F,0x09,0x09,0x0F,0x00,//"日"代码 0x02
0x07,0x04,0x07,0x04,0x07,0x00,0x04,0x07,//"星"左上半部分代码 0x03
0x1F,0x01,0x1F,0x01,0x1F,0x08,0x08,0x1F,//"星"右上半部分代码 0x04
0x08,0x17,0x00,0x1F,0x00,0x00,0x00,0x00,//"星"左下半部分代码 0x05
0x08,0x1F,0x08,0x1F,0x00,0x00,0x00,0x00//"星"右下半部分代码 0x06
};
uchar tab[]={'0','8',0x00,'0','3',0x01,'0','9',0x02};//显示"08年03月09日"
void delay(uint t)
{
uint x,y;
for(x=0;x<t;x++)
for(y=0;y<110;y++);
}
void write_com(uchar com)//向1602写指令
{
lcdrs=0;
P2=com;
delay(5);
lcden=1;
delay(5);
lcden=0;
}
#define uchar unsigned char
#define uint unsigned int
sbit lcdrs=P1^0;
sbit lcden=P1^2;
sbit lcdwr=P1^1;
uchar CGCODE[]={0x08,0x0F,0x12,0x0F,0x0A,0x1F,0x02,0x02,//"年"代码 0x00
0x0F,0x09,0x0F,0x09,0x0F,0x09,0x13,0x00,//"月"代码 0x01
0x0F,0x09,0x09,0x0F,0x09,0x09,0x0F,0x00,//"日"代码 0x02
0x07,0x04,0x07,0x04,0x07,0x00,0x04,0x07,//"星"左上半部分代码 0x03
0x1F,0x01,0x1F,0x01,0x1F,0x08,0x08,0x1F,//"星"右上半部分代码 0x04
0x08,0x17,0x00,0x1F,0x00,0x00,0x00,0x00,//"星"左下半部分代码 0x05
0x08,0x1F,0x08,0x1F,0x00,0x00,0x00,0x00//"星"右下半部分代码 0x06
};
uchar tab[]={'0','8',0x00,'0','3',0x01,'0','9',0x02};//显示"08年03月09日"
void delay(uint t)
{
uint x,y;
for(x=0;x<t;x++)
for(y=0;y<110;y++);
}
void write_com(uchar com)//向1602写指令
{
lcdrs=0;
P2=com;
delay(5);
lcden=1;
delay(5);
lcden=0;
}
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/98429507e423491ba49272e8a0d15892_zhanlangxin.jpg!1)
zhanlangxin
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)