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

📄 caidan.c

📁 一个msp430与320*240加4*4键盘的菜单程序... ...!
💻 C
字号:
//##############################################################################
//      菜单显示列表
//##############################################################################

#include <msp430x16x.h>
#include "display.h"
#include "XITONG.H"

void clock_disp()
{
               unsigned char temp1,temp2,temp3,temp4,temp5,temp6;
               temp6= (shi/10)%10;
               temp5= shi%10;
               temp4= (fen/10)%10;
               temp3= fen%10;
               temp2= (miao/10)%10;
               temp1= miao%10;
  
               //------------------------------
               showchar8(224,48,2,1);//2008
               showchar8(224,57,0,1);
               showchar8(224,66,0,1);
               showchar8(224,75,8,1);
               showchar16(224,84,3,1);//年 
               //------------------------------
               showchar8(224,100,1,1);//10
               showchar8(224,109,0,1);
               showchar16(224,118,4,1);//月
               //------------------------------
               showchar8(224,135,0,1);//08
               showchar8(224,143,8,1);
               showchar16(224,151,5,1);//日
               //------------------------------
               showchar8(224,168,temp6,1);//0
               showchar8(224,177,temp5,1);//8
               //------------------------------
               showchar8(224,185,11,1);//:
               //------------------------------
               showchar8(224,195,temp4,1);//0
               showchar8(224,204,temp3,1);//8
               //------------------------------
               showchar8(224,213,11,1);//:
               //------------------------------
               showchar8(224,222,temp2,1);//0
               showchar8(224,231,temp1,1);//8
               //------------------------------
}
//##############################################################################
void d0_5_1(void)
{              clr_grphram();//液晶清除全屏
               //Linexy(80,0,80,120,1);
               //Linexy(Uint x0,Uchar y0,Uint xt,Uchar yt,Uchar att,Uchar qu);
               showchar24(18,51,20,1);//一
               showchar24(18,75,21,1);//体
               showchar24(18,99,22,1);//化
               showchar24(18,123,23,1);//低
               showchar24(18,147,24,1);//压
               showchar24(18,171,25,1);//配
               showchar24(18,195,26,1);//电
               showchar24(18,219,27,1);//系
               showchar24(18,247,28,1);//统
               
               
               //Linexy(Uint x0,Uchar y0,Uint xt,Uchar yt,Uchar att);
               
               lineH(50,0,50,320);// 画水平线(Y1=Y2) X=8*i
               lineH(51,0,51,320);// 画水平线(Y1=Y2) X=8*i
               lineH(52,0,52,320);// 画水平线(Y1=Y2) X=8*i
               //lineH(y1,x1,y2,x2);// 画水平线(Y1=Y2) X=8*i
               //lineH(y1,x1,y2,x2);// 画水平线(Y1=Y2) X=8*i
               //lineH(y1,x1,y2,x2);// 画水平线(Y1=Y2) X=8*i
               
               
  
               showchar24(58,102,0,0);//图形显示
               showchar24(58,126,1,0);
               showchar24(58,150,2,0);
               showchar24(58,174,3,0);

               showchar24(92,102,4,1);//实时数据
               showchar24(92,126,5,1);
               showchar24(92,150,6,1);
               showchar24(92,174,7,1);

               showchar24(126,102,8,1);//其他告警
               showchar24(126,126,9,1);
               showchar24(126,150,10,1);
               showchar24(126,174,11,1);

               showchar24(160,102,12,1);//系统维护
               showchar24(160,126,13,1);
               showchar24(160,150,14,1);
               showchar24(160,174,15,1);
               //lineH(0,0,0,320);//画水平线
               //------------------------------
               showchar16(224,0,0,1);//时 
               showchar16(224,16,1,1);//间
               showchar16(224,32,2,1);//:
               //------------------------------
               showchar8(224,48,2,1);//2008
               showchar8(224,57,0,1);
               showchar8(224,66,0,1);
               showchar8(224,75,8,1);
               showchar16(224,84,3,1);//年 
               //------------------------------
               showchar8(224,100,1,1);//10
               showchar8(224,109,0,1);
               showchar16(224,118,4,1);//月
               //------------------------------
               showchar8(224,135,0,1);//08
               showchar8(224,143,8,1);
               showchar16(224,151,5,1);//日
               //------------------------------

               showchar8(224,168,0,1);//0
               showchar8(224,177,0,1);//8
               //------------------------------
               showchar8(224,185,11,1);//:
               //------------------------------
               showchar8(224,195,0,1);//0
               showchar8(224,204,0,1);//8
               //------------------------------
               showchar8(224,213,11,1);//:
               //------------------------------
               showchar8(224,222,0,1);//0
               showchar8(224,231,0,1);//8
               //------------------------------
               showchar8(224,249,32,1);//V
               showchar8(224,258,16,1);//E
               showchar8(224,267,28,1);//R
               showchar8(224,276,11,1);//:
               showchar8(224,285,2,1);//2
               showchar8(224,294,10,1);//.
               showchar8(224,303,0,1);//0
               showchar8(224,311,0,1);//0

               showchar24(200,0,16,0);//确
               showchar24(200,24,17,0);//定

               showchar24(200,272,18,0);//取 
               showchar24(200,296,19,0);//消
}
void d0_5_2(void)
{
                showchar24(58,102,0,0);//图形显示
                showchar24(58,126,1,0);
                showchar24(58,150,2,0);
                showchar24(58,174,3,0);

                showchar24(92,102,4,1);//实时数据
                showchar24(92,126,5,1);
                showchar24(92,150,6,1);
                showchar24(92,174,7,1);

                showchar24(126,102,8,1);//其他告警
                showchar24(126,126,9,1);
                showchar24(126,150,10,1);
                showchar24(126,174,11,1);

                showchar24(160,102,12,1);//系统维护
                showchar24(160,126,13,1);
                showchar24(160,150,14,1);
                showchar24(160,174,15,1);
}
void d0_5_3(void)
{
                showchar24(58,102,0,1);//图形显示
                showchar24(58,126,1,1);
                showchar24(58,150,2,1);
                showchar24(58,174,3,1);

                showchar24(92,102,4,0);//实时数据
                showchar24(92,126,5,0);
                showchar24(92,150,6,0);
                showchar24(92,174,7,0);

                showchar24(126,102,8,1);//其他告警
                showchar24(126,126,9,1);
                showchar24(126,150,10,1);
                showchar24(126,174,11,1);

                showchar24(160,102,12,1);//系统维护
                showchar24(160,126,13,1);
                showchar24(160,150,14,1);
                showchar24(160,174,15,1);
}
void d0_5_4(void)
{
                showchar24(58,102,0,1);//图形显示
                showchar24(58,126,1,1);
                showchar24(58,150,2,1);
                showchar24(58,174,3,1);

                showchar24(92,102,4,1);//实时数据
                showchar24(92,126,5,1);
                showchar24(92,150,6,1);
                showchar24(92,174,7,1);

                showchar24(126,102,8,0);//其他告警
                showchar24(126,126,9,0);
                showchar24(126,150,10,0);
                showchar24(126,174,11,0);

                showchar24(160,102,12,1);//系统维护
                showchar24(160,126,13,1);
                showchar24(160,150,14,1);
                showchar24(160,174,15,1);
}
void d0_5_5(void)
{
                showchar24(58,102,0,1);//图形显示
                showchar24(58,126,1,1);
                showchar24(58,150,2,1);
                showchar24(58,174,3,1);

                showchar24(92,102,4,1);//实时数据
                showchar24(92,126,5,1);
                showchar24(92,150,6,1);
                showchar24(92,174,7,1);

                showchar24(126,102,8,1);//其他告警
                showchar24(126,126,9,1);
                showchar24(126,150,10,1);
                showchar24(126,174,11,1);

                showchar24(160,102,12,0);//系统维护
                showchar24(160,126,13,0);
                showchar24(160,150,14,0);
                showchar24(160,174,15,0);
}
//##############################################################################
void d1_5_1(void)
{               clr_grphram();//液晶清除全屏
                showchar8(40,80,37,1);//"/"
                showchar8(40,88,38,1);//
                showchar8(40,96,38,1);//
                showchar8(40,104,38,1);//
                showchar8(40,112,38,1);//
                showchar8(40,120,38,1);//
                showchar8(40,128,38,1);//
                showchar8(40,136,38,1);//
                showchar8(40,142,38,1);//
                showchar8(40,150,38,1);//
                showchar8(40,158,38,1);//
                showchar8(40,166,38,1);//
                showchar8(40,174,38,1);//
                showchar8(40,182,38,1);//
                showchar8(40,190,38,1);//
                showchar8(40,198,38,1);//
                showchar8(40,206,37,1);//"/"
                //-------------------------------------
                showchar24(58,102,5,0);//时间设置
                showchar24(58,126,29,0);
                showchar24(58,150,30,0);
                showchar24(58,174,31,0);

                showchar24(92,102,32,1);//网络下载
                showchar24(92,126,33,1);
                showchar24(92,150,34,1);
                showchar24(92,174,35,1);

                showchar24(126,102,36,1);//查询空间
                showchar24(126,126,37,1);
                showchar24(126,150,38,1);
                showchar24(126,174,39,1);

                showchar24(160,102,12,1);//系统设置
                showchar24(160,126,13,1);
                showchar24(160,150,30,1);
                showchar24(160,174,31,1);
                
                showchar24(200,0,16,0);//确
                showchar24(200,24,17,0);//定

                showchar24(200,272,18,0);//取 
                showchar24(200,296,19,0);//消
}
void d1_5_2(void)
{
               
                showchar24(58,102,5,0);//时间设置
                showchar24(58,126,29,0);
                showchar24(58,150,30,0);
                showchar24(58,174,31,0);

                showchar24(92,102,32,1);//网络下载
                showchar24(92,126,33,1);
                showchar24(92,150,34,1);
                showchar24(92,174,35,1);

                showchar24(126,102,36,1);//查询空间
                showchar24(126,126,37,1);
                showchar24(126,150,38,1);
                showchar24(126,174,39,1);

                showchar24(160,102,12,1);//系统设置
                showchar24(160,126,13,1);
                showchar24(160,150,30,1);
                showchar24(160,174,31,1);

}
void d1_5_3(void)
{
               
                showchar24(58,102,5,1);//时间设置
                showchar24(58,126,29,1);
                showchar24(58,150,30,1);
                showchar24(58,174,31,1);

                showchar24(92,102,32,0);//网络下载
                showchar24(92,126,33,0);
                showchar24(92,150,34,0);
                showchar24(92,174,35,0);

                showchar24(126,102,36,1);//查询空间
                showchar24(126,126,37,1);
                showchar24(126,150,38,1);
                showchar24(126,174,39,1);

                showchar24(160,102,12,1);//系统设置
                showchar24(160,126,13,1);
                showchar24(160,150,30,1);
                showchar24(160,174,31,1);

}
void d1_5_4(void)
{
               
                showchar24(58,102,5,1);//时间设置
                showchar24(58,126,29,1);
                showchar24(58,150,30,1);
                showchar24(58,174,31,1);

                showchar24(92,102,32,1);//网络下载
                showchar24(92,126,33,1);
                showchar24(92,150,34,1);
                showchar24(92,174,35,1);

                showchar24(126,102,36,0);//查询空间
                showchar24(126,126,37,0);
                showchar24(126,150,38,0);
                showchar24(126,174,39,0);

                showchar24(160,102,12,1);//系统设置
                showchar24(160,126,13,1);
                showchar24(160,150,30,1);
                showchar24(160,174,31,1);

}
void d1_5_5(void)
{
               
                showchar24(58,102,5,1);//时间设置
                showchar24(58,126,29,1);
                showchar24(58,150,30,1);
                showchar24(58,174,31,1);

                showchar24(92,102,32,1);//网络下载
                showchar24(92,126,33,1);
                showchar24(92,150,34,1);
                showchar24(92,174,35,1);

                showchar24(126,102,36,1);//查询空间
                showchar24(126,126,37,1);
                showchar24(126,150,38,1);
                showchar24(126,174,39,1);

                showchar24(160,102,12,0);//系统设置
                showchar24(160,126,13,0);
                showchar24(160,150,30,0);
                showchar24(160,174,31,0);

}

void d2(void)//显示表格
{
  clr_grphram();//液晶清除全屏
  line(8,8,188,8);             //竖线
  line(8,80,188,80);
  line(8,160,188,160);
  line(8,240,188,240);
  line(8,312,188,312);
  
  lineH(8,8,8,312);            //横线
  lineH(38,8,38,312);
  lineH(68,8,68,312);
  lineH(98,8,98,312);
  lineH(128,8,128,312);
  lineH(158,8,158,312);
  lineH(188,8,188,312);
  //lineH(230,8,230,312);
  
  showchar16(16,16,0,1);//时 
  showchar16(16,32,1,1);//间
}

⌨️ 快捷键说明

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