基于51单片机 DS1302 LCD1602数字时钟显示

基于51单片机 DS1302 LCD1602数字时钟显示

#include

#include

#include

#define uint unsigned int

#define uchar unsigned char

uchar code table[]="I LIKE MCU!";

sbit RS=P2^0;

sbit RW=P2^1;

sbit EN=P2^2;

sbit IO=P1^0;

sbit sclk=P1^1;

sbit rst=P1^2;

uchar *week[]={"SUN","****","MON","TUS","WEN","THU","FRI","SAT"}; uchar lcd_buffer1[]={"DA TE 00-00-00 "};

uchar lcd_buffer2[]={"TIME 00:00:00 "};

uchar datetime[7];

void delay(uchar ms)

{

uchar i;

while(ms--)

for(i=0;i<120;i++);

相关推荐
相关主题
热门推荐