}
}
}
}
time_buf1[3]=j;
sprintf(shishi,\lcdwrite_com(0x80+8); for(j=0;j<2;j++) { }
lcdwrite_com(0x80+9); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]);
if(i==4)//月 { }
if(i==5)//年 {
j=time_buf1[1]; j++; if(j==99) { }
time_buf1[1]=j;
sprintf(shishi,\lcdwrite_com(0x80+2); for(j=0;j<2;j++) {
18
j=0; j=time_buf1[2]; j++; if(j==60) { }
time_buf1[2]=j;
sprintf(shishi,\lcdwrite_com(0x80+5); for(j=0;j<2;j++) { }
lcdwrite_com(0x80+6); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]); j=0;
}
}
}
}
lcdwrite_date(shishi[j]);
lcdwrite_com(0x80+3); lcdwrite_com(0x0f);
ds1302write();
if(jian==0) {
delay(5); if(jian==0) {
while(!jian); if(i==1)//分 { }
if(i==2)//时 {
j=time_buf1[4]; j--; if(j==-1) { }
time_buf1[4]=j;
sprintf(shishi,\lcdwrite_com(0xc0); for(j=0;j<2;j++)
19
j=23; j=time_buf1[5]; j--; if(j==-1) { }
time_buf1[5]=j;
sprintf(shishi,\lcdwrite_com(0xc0+3); for(j=0;j<2;j++) { }
lcdwrite_com(0xc0+4); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]); j=59;
}
{ }
lcdwrite_com(0xc0+1); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]);
if(i==3)//日 { }
if(i==4)//月 { }
if(i==5)//年 {
20
j=time_buf1[2]; j--; if(j==-1) { }
time_buf1[2]=j;
sprintf(shishi,\lcdwrite_com(0x80+5); for(j=0;j<2;j++) { }
lcdwrite_com(0x80+6); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]); j=0; j=time_buf1[3]; j--; if(j==-1) { }
time_buf1[3]=j;
sprintf(shishi,\lcdwrite_com(0x80+8); for(j=0;j<2;j++) { }
lcdwrite_com(0x80+9); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]); j=0;
}
}
}
}
}
}
j=time_buf1[1]; j--; if(j==-1) { }
time_buf1[1]=j;
sprintf(shishi,\lcdwrite_com(0x80+2); for(j=0;j<2;j++) { }
lcdwrite_com(0x80+3); lcdwrite_com(0x0f);
lcdwrite_date(shishi[j]); j=0;
ds1302write();
void Timer0_isr(void) interrupt 1 {
static unsigned int num; TH0=(65536-2000)/256; TL0=(65536-2000)%6; num++;
if(num==30) { num=0;
ReadTempFlag=1; }
//LCD1602模块程序 #include \
unsigned char time_buf1[8] = {20,10,6,5,12,55,00,6}; unsigned char time_buf[8] ;
void ds1302writebyte(unsigned char addr, unsigned char d) {
unsigned char i; rst=1;
addr=addr&0xFE; for(i=0;i<8;i++)
21
}
相关推荐: