微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 基于STM32的多功能数字钟(中文版)

基于STM32的多功能数字钟(中文版)

时间:11-18 来源:互联网 点击:

case 1: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*14,140,24,24,24," ");

break;

}

else goto kk2;

}

case 2: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*10,140,24,24,24," ");

break;

}

else goto kk2;

}

case 3: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*6,140,24,24,24," ");

break;

}

else goto kk2;

}

case 4: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*6,180,24,24,24," ");

break;

}

else goto kk2;

}

case 5: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*16,100,24,24,24," ");

break;

}

else goto kk2;

}

case 6: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*12,100,24,24,24," ");

break;

}

else goto kk2;

}

case 7: {

if(flag_250ms==1)

{

LCD_ShowString(10+12*6,100,48,24,24," ");

break;

}

else goto kk2;

}

case 8: {

if(flag_250ms==1)

{

LCD_ShowString(30+12*8,180,24,24,24," ");

break;

}

else goto kk2;

}

case 9: {

if(flag_250ms==1)

{

LCD_ShowString(30+12*4,180,24,24,24," ");

break;

}

else goto kk2;

}

kk2:

{

sprintf(temp,"日期:%04d年%02d月%02d日",calendar.w_year,calendar.w_month,calendar.w_date);

Show_Str(10,100,220,24,temp,24,0);

sprintf(temp,"时间:%02d时%02d分%02d秒 ",calendar.hour,calendar.min,calendar.sec);

Show_Str(10,140,220,24,temp,24,0);

if(flag_tiao<=7)

{sprintf(temp,"星期:%01d",calendar.week);

Show_Str(10,180,100,24,temp,24,0); }

else

{

sprintf(temp,"闹铃:%02d时%02d分 ",calendar.al_hour,calendar.al_min);

Show_Str(10,180,220,24,temp,24,0); }

break;

}

default :break ;

}

}

else//正常显示

{

if(sec_back!=calendar.sec)

{

sprintf(temp,"日期:%04d年%02d月%02d日",calendar.w_year,calendar.w_month,calendar.w_date);

Show_Str(10,100,220,24,temp,24,0);

sprintf(temp,"时间:%02d时%02d分%02d秒 ",calendar.hour,calendar.min,calendar.sec);

Show_Str(10,140,220,24,temp,24,0);

sprintf(temp,"星期:%01d ",calendar.week);

Show_Str(10,180,220,24,temp,24,0);

}

}

keyfunction();//按键扫描和功能解析(包括了开发板上的按键、红外遥控按键、触摸按键)

if(flag_1s ==1)//每秒读取一次温度

{

flag_1s =0;

//LCD_ShowString(30+5*12,180,210,24,24," ");

temp5=DS18B20_Get_Temp();

sprintf(temp,"温度:%02d.%01d℃",temp5/10,temp5%10);

Show_Str(10,220,210,24,temp,24,0);

}

}

}

/*

函数功能:显示画图框

*/

void Load_Drow_Dialog(void)

{

LCD_Clear(RED);//清屏

POINT_COLOR=BLUE;//设置字体为蓝色

LCD_ShowString(lcddev.width-30,0,200,24,24,"RST");//显示清屏区域

}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top