|
本帖最后由 lids 于 2017-9-26 14:16 编辑
DS12C887做21位数码管万年历仿真,3片MAX7219级联做数码管驱动,程序是论坛里的,但是原来的程序有误,我都修改好了的。完整源程序和仿真文件见附件。需要的就去下载。图片上是调到27日的- #include "main.h"
- #include "max7219.h"
- #include "ds18b20.h"
- #include "ds12c887.h"
- #include "display.h"
- #include "yinli.h"
- #include "key.h"
- uchar time_year,time_month,time_day,time_week,time_hour,time_min,time_sec;
- uchar c_moon,year_moon,month_moon,day_moon;
- uchar year_h,year_l,week,month_h,month_l,day_h,day_l,hour_h,hour_l,min_h,min_l,sec_h,sec_l;
- uchar month_lunar_h ,month_lunar_l ,date_lunar_l,date_lunar_h;
- uchar hide_min,hide_hour,hide_day,hide_week,hide_month,hide_year;
- uchar temp_value;
- uchar TempBuffer[2];
- bit flag;
- uchar count;
- bit up_flag;
- bit down_flag;
- uchar temp_1;
- void main()
- {
- DS12C887_init();
- DS12C887_Settime();
- InitDis ();
- Init_DS18B20();
- //WDT_CONTR = 0X37;
- while(1)
- {
-
- while(flag)
- {
-
- timedone();
- }
- while(!flag)
- {
- ReadTemp();
- temp_to_str();
- display();
- scankey();
- //WDT_CONTR =0X37;
- }
-
- }
- }
复制代码
|
评分
-
查看全部评分
|