您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 基于51单片机的多功能数字钟
  所属分类: C++
  开发工具:
  文件大小: 250kb
  下载次数: 0
  上传时间: 2013-12-30
  提 供 者: u0126*****
 详细说明: 基于51单片机的多功能数字钟 片段代码: #include #include "lcd1602.h" #include "ds1302.h" #include "button.c" sbit buzzer=P1^7; char time_h=0,time_m=0; void scankey(); void main() { uchar t=0,i=0,j=0; buzzer=0; LCD_Initial(); //Init_DS1302(); //仿真不需加 buzzer=0; //LCD_Write(0,0x0d);LCD_Write(0,0x04); while(1) { j=0; scankey(); if(!k_flag0 || flag_xx) //键没未按or设置闹钟 { if(flag_xx) //闹钟 { j=1; if(!t)LCD_Write(0,0x01); else t=1; t++; L1602_string(1,1,"Seting Alarm:"); if(!time_h)time_h=hour; if(!time_m)time_m=minute; Set_Alarm(2,1,time_h,time_m); //LCD_Write(0,0x0d); goto_XY(count_y,count_x); if(count_x==1) { if((shi>0&&(time_h/10!=2)) || (shi<0 &&(time_h/10!=0)))time_h+=shi*10; } else if(count_x==2) { if((ge>0&&(time_h!=9)) || (ge<0 &&(time_h!=0)))time_h+=ge; } else if(count_x==4) { if((shi>0&&(time_m/10!=5)) || (shi<0 &&(time_m/10!=0)))time_m+=shi*10; } else if(count_x==5) { if((ge>0&&(time_m!=9)) || (ge<0 &&(time_m!=0)))time_m+=ge; } //L1602_char(2,7,'0'+time_h/10); //L1602_char(2,11,0x30+count_x); //L1602_char(2,14,0x30+flag_xx); if(count_x>5)count_x=1; shi=ge=0; set_time[0]=time_h;set_time[1]=time_m; } else //正常显示 { j=2;t=0; (void)ReadTemperature(); diaplay_Temperature(2,9,integer_value,fraction_value); diaplay_calendar(1,1,2,1); if(hour==set_time[0]&&minute==set_time[1])buzzer=1; else buzzer=0; } } else //时间设置 { LCD_Write(0,0x0f); // goto_XY(count_y,count_x); t=0; if(count_x==1)L1602_char(count_y,count_x,0x30+hour/10); else if(count_x==2)L1602_char(count_y,count_x,0x30+hour); else if(count_x==4)L1602_char(count_y,count_x,0x30+minute/10); else if(count_x==5)L1602_char(count_y,count_x,0x30+minute); else if(count_x==6)L1602_char(count_y,count_x,0x30+mouth/10); else if(count_x==7)L1602_char(count_y,count_x,0x30+mouth); else if(count_x==9)L1602_char(count_y,count_x,0x30+day/10); else if(count_x==10)L1602_char(count_y,count_x,0x30+day); shi=ge=0; if(k_flag3) //时间设定完成、各值恢复原值。 { k_flag0=0;k_flag3=0; count_x=0;count_y=2; LCD_Write(0,0x0c); DS1302_reset(mouth,day,hour,minute); ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: 多功能数字钟
 输入关键字,在本站1000多万海量源码库中尽情搜索: