基于ds130251单片机简易实时时钟 1602显示 源程序.docxVIP

  • 9
  • 0
  • 约 7页
  • 2018-04-14 发布于贵州
  • 举报

基于ds130251单片机简易实时时钟 1602显示 源程序.docx

基于ds130251单片机简易实时时钟 1602显示 源程序

==================主程序================= #include reg51.h #include ds1302.h #include LCD1602.h void change(); uchar times[9]; uchar date[9]; main() {LCD_init();//LCD初始化 init_1302(time_1302); gotoxy(1,1); LCD_display(Time:); gotoxy(1,2); LCD_display(Date:); times[8]=\0;// date[8]=\0; while(1) {get_1302(time_1302); change(); gotoxy(7,1); LCD_display(times); gotoxy(7,2); LCD_display(date); } } /*=========================== 转 换 子 程 序 ===========================*/ void change() { // 时 间 的 转 换 times[0]=time_1302[2]/10+0; times[1]=time_1302[2]%10+0; times[2]=:; times[3]=time_1302[1]/10+0; times[4

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档