⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getinformations.c

📁 用单片机做的数字万年历
💻 C
字号:
   #include <includes.h>
	  
   #include <temperature.c>
   #include <solar_to_lunar.c>
	  void getinformations(void)
	  {		  
	          
	          

	  		   unsigned char temp,second_before=0;
	           temp=GetSeconds();
               second_before=second_l;
               second_l=(temp&0x0f);//秒个位
               
               second_h=((temp&0xf0)>>4);	//此括号不能少,否则>>先与大左边的结合!!!
		       temp=GetMinutes();
               minu_l=(temp&0x0f);//分个位
               minu_h=((temp&0xf0)>>4);	
			   temp=GetHours();
               temp=temp&0x7f;//去掉12制小时(下午)的最高位
               hour_l=(temp&0x0f);//小时个位
              if(second_l!=second_before)  hour_l=hour_l|0x80;//让小时后的" : "每秒闪烁一次
               hour_h=((temp&0xf0)>>4);
			   if (hour_h==0)  hour_h=0x0f;//小时的高位为0时,不显示.
			   temp=GetDate();
               day_moon=temp;//保存日

               date_l=(temp&0x0f);//日个位
               date_h=((temp&0xf0)>>4);	
			   if(date_h==0)  date_h=0x0f;//日的高位为0时,不显示.
			   temp=GetWeek();
			   if (temp==7)		 temp=8;
			   week_l=(temp&0x0f);	//星期	
			   temp=GetMonth();
			   month_moon=temp; //保存月
               month_l=(temp&0x0f);//月个位
               month_h=((temp&0xf0)>>4);
			   if(month_h==0)     month_h=0x0f;//月的高位为0时不显示
			   temp=GetYear();
			  year_moon= temp ;//保存年

               year_l=(temp&0x0f);//年个位
               year_h=((temp&0xf0)>>4);
			   temp=GetCentury();
               centurary_l=(temp&0x0f);//世纪个位
               centurary_h=((temp&0xf0)>>4);
               
			   Conversion(0,year_moon,month_moon,day_moon);
			   month_lunar_h=((month_moon&0xf0)>>4);
			   if(month_lunar_h==0)   month_lunar_h=0x0f;//阴历月的高位为0时,不显示.
			   month_lunar_l=(month_moon&0x0f);// 阴历月个位
               date_lunar_h=((day_moon&0xf0)>>4);
			   if (date_lunar_h==0)   date_lunar_h=0x0f;//阴历日的高位为0时,不显示.
			   date_lunar_l=(day_moon&0x0f);//阴历日个位
			   temp=temperature();
               temperature_h=((temp&0xf0)>>4);
			   if (temperature_h==0)   temperature_h=0x0f;//温度的高位为0时,不显示.
               temperature_l=(temp&0x0f);
			   temp=sflag;
			   if (temp==1) temperature_s=0x0f;
			   else         temperature_s=0x0a;//温度为	负,显示"一"号.

			   }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -