8051 与 LCD1602 液晶显示时钟编译并仿真成功.docxVIP

  • 3
  • 0
  • 约2.3千字
  • 约 6页
  • 2017-07-04 发布于天津
  • 举报

8051 与 LCD1602 液晶显示时钟编译并仿真成功.docx

8051 与 LCD1602 液晶显示时钟编译并仿真成功.docx

8051 与 LCD1602 液晶显示时钟电路仿真图Keil C51源程序#include reg52.h#define uchar unsigned char#define uint unsigned intsbitrs=P2^0;sbitrw=P2^1;sbit en=P2^2;sbit K1=P1^0;sbit K2=P1^1;sbit K3=P1^2;sbit K4=P1^3;uchar Count,s1num;charshi,fen,miao;uchar code table[]= 2014-4-23 Wed;uchar code table1[]= 00:00:00 ;//延时函数void delay(uint z){uchari;while(z--)for(i=0;i120;i++);}//LCD1602写命令函数voidwrite_com(uchar com){rs=0;rw=0;en=0; P0=com;delay(5);en=1;delay(5);en=0; }//LCD1602 写数据函数voidwrite_date(uchardat) {rs=1;rw=0;en=0; P0=dat;delay(5);en=1;delay(5);en=0; }//LCD1602初始化函数voidinit(){uchar num;write_com(0x38

文档评论(0)

1亿VIP精品文档

相关文档