资源简介
基于51单片的多功能万年历,LCD12864做显示,DS1302做时钟芯片,DS18B20实现温度采集。

代码片段和文件信息
#include
#include“Com.h“
#include“LCD12864.h“
#include“DS1302.h“
#include“Calendar.h“
#include“Calendate.h“
/********************************************************************************
* 名称: get_moon_day(uchar month_puint table_addr)
* 功能: 读取数据表中农历的大月或小月 ,如果大月返回1 小月返回0
* 入口参数:
* 出口参数:
*********************************************************************************/
bit get_moon_day( uchar month_puint calendar_address )
{
uchar temp;
switch(month_p)
{
case 1: { temp = year_code[calendar_address] & 0x08; if(temp==0) return(0); else return(1); }
case 2: { temp = year_code[calendar_address] & 0x04; if(temp==0) return(0); else return(1); }
case 3: { temp = year_code[calendar_address] & 0x02; if(temp==0) return(0); else return(1); }
case 4: { temp = year_code[calendar_address] & 0x01; if(temp==0) return(0); else return(1); }
case 5: { temp = year_code[calendar_address + 1] & 0x80; if(temp==0) return(0); else return(1); }
case 6: { temp = year_code[calendar_address + 1] & 0x40; if(temp==0) return(0); else return(1); }
case 7: { temp = year_code[calendar_address + 1] & 0x20; if(temp==0) return(0); else return(1); }
case 8: { temp = year_code[calendar_address + 1] & 0x10; if(temp==0) return(0); else return(1); }
case 9: { temp = year_code[calendar_address + 1] & 0x08; if(temp==0) return(0); else return(1); }
case 10: { temp = year_code[calendar_address + 1] & 0x04; if(temp==0) return(0); else return(1); }
case 11: { temp = year_code[calendar_address + 1] & 0x02; if(temp==0) return(0); else return(1); }
case 12: { temp = year_code[calendar_address + 1] & 0x01; if(temp==0) return(0); else return(1); }
case 13: { temp = year_code[calendar_address + 2] & 0x80; if(temp==0) return(0); else return(1); }
}
}
/**************************************************************************
* 名称: void Calendar_Convert( uchar * clock_time )
* 功能: 输入BCD的阳历数据, 输出BCD阴历数据( 1901 - 2099 )
* 入口参数: c_flag:阳历的世纪标志 clock_time: 时钟地址
* 出口参数: 无
* 说明: c_flag = 0 :21世纪 c_flag = 1 :19世纪
*****************************************************************************/
void Calendar_Convert( uchar c_flag SYSTEMTIME * clock_time )
{
bit flag_month flag_year;
uchar year month day month_point; //定义 年 月 天
uchar temp1 temp2 temp3;
uint calendar_address; //定义农历地址
uint day_number;
uchar calendar[6]; //定义阴历
day=clock_time->Day;
month=clock_time->Month;
year=clock_time->Year;
calendar_address = year * 3;
//春节(正月初一)所在的阳历月份
temp1 = year_code[ calendar_address + 2 ] & 0x60; //Bit6~~Bit5:春节所在的阳历月份
temp1 >>= 5 ;
//春节(正月初一)所在的阳历日期
temp2 = year_code[ calendar_address + 2 ] & 0x1f; //Bit4~~Bit0:春节所在的阳历日期
//计算春节(正月初一)离当年元旦{ 1月1日(阳历) }的天数;春节只会在阳历的1月 或 2月
if( temp1 == 1 )
temp3 = temp2 - 1;
else
temp3 = temp2 + 31 - 1;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12701 2012-02-11 20:25 多功能电子万年历代码\Calendar.LST
文件 1786 2012-02-11 20:25 多功能电子万年历代码\Com.LST
文件 11689 2012-02-11 20:25 多功能电子万年历代码\DS1302.LST
文件 6005 2012-02-11 20:25 多功能电子万年历代码\Ds18b20.LST
文件 1628 2010-01-02 18:19 多功能电子万年历代码\Interrupt.LST
文件 8189 2012-02-11 20:25 多功能电子万年历代码\LCD12864.LST
文件 22783 2012-02-11 20:25 多功能电子万年历代码\Menus.LST
文件 11665 2012-02-11 20:25 多功能电子万年历代码\STARTUP.LST
文件 6033 2012-02-11 20:25 多功能电子万年历代码\Test.LST
文件 170 2010-01-01 14:44 多功能电子万年历代码\Calendar.h
文件 5819 2010-01-01 14:39 多功能电子万年历代码\Calendate.h
文件 265 2009-12-24 22:21 多功能电子万年历代码\Com.h
文件 1397 2012-02-11 19:33 多功能电子万年历代码\DS1302.h
文件 178 2010-01-01 20:08 多功能电子万年历代码\Ds18b20.h
文件 1178 2012-02-11 19:12 多功能电子万年历代码\Interrupt.h
文件 637 2012-02-11 19:32 多功能电子万年历代码\LCD12864.h
文件 101 2012-02-11 19:34 多功能电子万年历代码\Menus.h
文件 6684 2012-02-11 20:25 多功能电子万年历代码\Zimo.h
文件 7207 2012-02-11 20:27 多功能电子万年历代码\Calendar.c
文件 698 2012-02-11 20:19 多功能电子万年历代码\Com.c
文件 6351 2010-01-02 00:09 多功能电子万年历代码\DS1302.c
文件 2849 2012-02-11 20:26 多功能电子万年历代码\Ds18b20.c
文件 2 2010-01-02 18:20 多功能电子万年历代码\Interrupt.c
文件 4031 2012-02-11 20:23 多功能电子万年历代码\LCD12864.c
文件 7281 2012-02-11 18:47 多功能电子万年历代码\Menus.c
文件 2576 2012-02-11 18:53 多功能电子万年历代码\Test.c
文件 7207 2012-02-11 20:27 多功能电子万年历代码\Calendar.bak
文件 711 2012-02-11 19:53 多功能电子万年历代码\Com.bak
文件 1399 2012-02-11 19:33 多功能电子万年历代码\DS1302.bak
文件 2849 2012-02-11 20:26 多功能电子万年历代码\Ds18b20.bak
............此处省略29个文件信息
- 上一篇:QT5串口通信程序源码
- 下一篇:学籍数据库
相关资源
- 利用DS1302和msp430进行闹钟和万年历的
- 【单片机】51单片机数码管显示万年历
- 制作万年历 日期 农历 温度显示
- 基于PIC单片机的万年历的设计
- lcd12864的VHDL程序
- LCD12864滚动显示
- protues万年历仿真
- 万年历系统汇编语言课程设计
- STM32 电子密码锁设计,LCD12864显示
- STM32 LCD12864并口驱动实验
- 百度万年历 日期选择控件 带农历节日
- 易语言天文算法万年历源码
- DS1302+DS13B20+12864,万年历。农历
- 实用万年历Sywnlv6.11
- Lcd12864大时钟万年历 农历生肖温度
- LCD12864驱动程序 带字库版本ST7920内含
- LCD12864驱动程序 并口通信,带字库版
- 12864多功能万年历
- STC89C52+LCD12864+18B20+1302万年历
- 1901-2100年黄历(execl版方便移植
- 电子万年历的设计51单片机 Proteus仿真
- 带字库LCD12864ST7920的Proteus仿真
- 精装万年历-V2.5.xls
- 基于51单片机电子万年历的设计
- VHDL电子万年历
- LCD12864不带字库code
- 通过DS18B20检测环境温度,并在LCD128
- 日历黄历源码以及黄历信息数据库
- 51单片机时钟设计.rar
- STM32+lcd12864串行方式显示贪吃蛇代码
评论
共有 条评论