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

📄 lcd.c

📁 240128液晶底层驱动以及键盘操作编写菜单
💻 C
📖 第 1 页 / 共 5 页
字号:
 LCD_Write_word(2,112,"-------[PgUp] [PgDn]------%",0);
////////向指定位置写入数据/////////////////////////////////////////
///////因为光标的位置需要具体指定////这里无法做成循环只能罗列/////////////
 Disp_Data_2(11,16,*ptr++);
 Disp_Data_3(25,16,*ptr++);
 Disp_Data_2(11,32,*ptr++);
 Disp_Data_3(25,32,*ptr++);
 Disp_Data_2(11,48,*ptr++);
 Disp_Data_2(26,48,*ptr++);
 Disp_Data_2(11,64,*ptr++);
 Disp_Data_1(26,64,*ptr);
//////////写入数据结束//////////////////////
 LCD_Disp_Frame_S();///////外框维护/////////////
}
////////////5号界面函数///////////////////////////////
void Disp_interface_5(uint *ptr)
{
 LCD_Write_word(0,0,"* 北京电通伟业电子设备有限公司%",0);//头标//
 LCD_Write_word(2,16,"相  行  行行绿  黄红短  长%",0);
 LCD_Write_word(2,32,"位  绿  闪红闪  灯灯绿  绿%",0);
 LCD_Write_word(2,48,"一:                       %",0);
 LCD_Write_word(2,64,"二:                       %",0);
 LCD_Write_word(2,80,"散:                       %",0);//叁//
 LCD_Write_word(2,96,"四:                       %",0);
 LCD_Write_word(2,112,"-------[PgUp] [PgDn]------%",0);
////////向指定位置写入数据/////////////////////////////////////////
///////因为光标的位置需要具体指定////这里无法做成循环只能罗列/////////////
 Disp_Data_3(5, 48,*ptr++);
 Disp_Data_2(10,48,*ptr++);
 Disp_Data_2(12,48,*ptr++);
 Disp_Data_2(14,48,*ptr++);
 Disp_Data_2(18,48,*ptr++);
 Disp_Data_2(20,48,*ptr++);
 Disp_Data_2(22,48,*ptr++);
 Disp_Data_3(25,48,*ptr++);
 /////////////////////////
 Disp_Data_3(5, 64,*ptr++);
 Disp_Data_2(10,64,*ptr++);
 Disp_Data_2(12,64,*ptr++);
 Disp_Data_2(14,64,*ptr++);
 Disp_Data_2(18,64,*ptr++);
 Disp_Data_2(20,64,*ptr++);
 Disp_Data_2(22,64,*ptr++);
 Disp_Data_3(25,64,*ptr++);
 ///////////////////////
 Disp_Data_3(5, 80,*ptr++);
 Disp_Data_2(10,80,*ptr++);
 Disp_Data_2(12,80,*ptr++);
 Disp_Data_2(14,80,*ptr++);
 Disp_Data_2(18,80,*ptr++);
 Disp_Data_2(20,80,*ptr++);
 Disp_Data_2(22,80,*ptr++);
 Disp_Data_3(25,80,*ptr++);
 ////////////////////////////////////
 Disp_Data_3(5, 96,*ptr++);
 Disp_Data_2(10,96,*ptr++);
 Disp_Data_2(12,96,*ptr++);
 Disp_Data_2(14,96,*ptr++);
 Disp_Data_2(18,96,*ptr++);
 Disp_Data_2(20,96,*ptr++);
 Disp_Data_2(22,96,*ptr++);
 Disp_Data_3(25,96,*ptr);
 /////////写入数据结束/////////////////////////
 LCD_Disp_Frame_S();///外框维护/////
}
////////////6号界面函数///////////////////////////////
void Disp_interface_6(uint *ptr)
{
 LCD_Write_word(0,0,"* 北京电通伟业电子设备有限公司%",0);//头标//
 LCD_Write_word(2,16,"相  行  行行绿  黄红短  长%",0);
 LCD_Write_word(2,32,"位  绿  闪红闪  灯灯绿  绿%",0);
 LCD_Write_word(2,48,"五:                       %",0);
 LCD_Write_word(2,64,"六:                       %",0);
 LCD_Write_word(2,80,"七:                       %",0);
 LCD_Write_word(2,96,"八:                       %",0);
 LCD_Write_word(2,112,"--------- [PgUp] ---------%",0);
////////向指定位置写入数据/////////////////////////////////////////
///////因为光标的位置需要具体指定////这里无法做成循环只能罗列/////////////
 Disp_Data_3(5, 48,*ptr++);
 Disp_Data_2(10,48,*ptr++);
 Disp_Data_2(12,48,*ptr++);
 Disp_Data_2(14,48,*ptr++);
 Disp_Data_2(18,48,*ptr++);
 Disp_Data_2(20,48,*ptr++);
 Disp_Data_2(22,48,*ptr++);
 Disp_Data_3(25,48,*ptr++);
 /////////////////////////
 Disp_Data_3(5, 64,*ptr++);
 Disp_Data_2(10,64,*ptr++);
 Disp_Data_2(12,64,*ptr++);
 Disp_Data_2(14,64,*ptr++);
 Disp_Data_2(18,64,*ptr++);
 Disp_Data_2(20,64,*ptr++);
 Disp_Data_2(22,64,*ptr++);
 Disp_Data_3(25,64,*ptr++);
 ///////////////////////
 Disp_Data_3(5, 80,*ptr++);
 Disp_Data_2(10,80,*ptr++);
 Disp_Data_2(12,80,*ptr++);
 Disp_Data_2(14,80,*ptr++);
 Disp_Data_2(18,80,*ptr++);
 Disp_Data_2(20,80,*ptr++);
 Disp_Data_2(22,80,*ptr++);
 Disp_Data_3(25,80,*ptr++);
 ////////////////////////////////////
 Disp_Data_3(5, 96,*ptr++);
 Disp_Data_2(10,96,*ptr++);
 Disp_Data_2(12,96,*ptr++);
 Disp_Data_2(14,96,*ptr++);
 Disp_Data_2(18,96,*ptr++);
 Disp_Data_2(20,96,*ptr++);
 Disp_Data_2(22,96,*ptr++);
 Disp_Data_3(25,96,*ptr);
 /////////写入数据结束/////////////////////////
 LCD_Disp_Frame_S();//////外框维护///////
}
/////////////////////////////////////////////////////
/*
////////////7号界面函数///////////////////////////////
void Disp_interface_7(uchar *ptr)
{
 //uchar i;
 LCD_Write_word(0,0,"* 北京电通伟业电子设备有限公司%",0);//头标//
 LCD_Write_word(2,16,"A.控制方案 ----%",0);
 LCD_Write_word(2,32,"  定时方案:[ ]中心闪烁:[ ]%",0);
 LCD_Write_word(2,48,"  交通反应:[ ]相位控制:[ ]%",0);
 LCD_Write_word(2,64,"  现场手动:[ ]感应方案:[ ]%",0);
 LCD_Write_word(2,80,"  中心手动:[ ]特勤模式:[ ]%",0);
 LCD_Write_word(2,96,"  目前控制模式...[        ]%",0);////// LCD_Write_word(2,96,"  目前控制模式...[定时方案]%",0);////
 LCD_Write_word(2,112,"---------- [PgDn] --------%",0);
//////////////////////////////////////////////////////////
 Disp_Zimu(14,32,*ptr++);
 Disp_Zimu(26,32,*ptr++);
 Disp_Zimu(14,48,*ptr++);
 Disp_Zimu(26,48,*ptr++);
 Disp_Zimu(14,64,*ptr++);
 Disp_Zimu(26,64,*ptr++);
 Disp_Zimu(14,80,*ptr++);
 Disp_Zimu(26,80,*ptr);
////////////////////////////////////////////////////////
 LCD_Disp_Frame_S();
}
////////////8号界面函数///////////////////////////////
void Disp_interface_8(uchar *ptr)
{
 LCD_Write_word(0,0,"* 北京电通伟业电子设备有限公司%",0);//头标//
 LCD_Write_word(2,16,"B.感应状况 ----%",0);
 LCD_Write_word(2,32,"  全感应:[ ]  火车优先:[ ]%",0);
 LCD_Write_word(2,48,"  半感应:[ ]  行人感应:[ ]%",0);
 LCD_Write_word(2,64,"  目前感应状况.....:[NONE]%",0);
 LCD_Write_word(2,80,"C.面板状况 ----%",0);
 LCD_Write_word(2,96,"  面板全红:[ ]面板闪烁:[ ]%",0);
 LCD_Write_word(2,112,"-------[PgUp] [PgDn]------%",0);
//////////////////////////////////////////////////////
 Disp_Zimu(12,32,*ptr++);
 Disp_Zimu(26,32,*ptr++);
 Disp_Zimu(12,48,*ptr++);
 Disp_Zimu(26,48,*ptr++);
 Disp_Zimu(23,64,*ptr++);
 Disp_Zimu(24,64,*ptr++);
 Disp_Zimu(25,64,*ptr++);
 Disp_Zimu(26,64,*ptr++);
 Disp_Zimu(14,96,*ptr++);
 Disp_Zimu(26,96,*ptr);
///////////////////////////////////////////////////////
 LCD_Disp_Frame_S();
}
////////////9号界面函数///////////////////////////////
void Disp_interface_9(uchar *ptr)
{
 LCD_Write_word(0,0,"* 北京电通伟业电子设备有限公司%",0);//头标//
 LCD_Write_word(2,16,"  面板手动:[ ]面板测试:[ ]%",0);
 LCD_Write_word(2,32,"D.小门状况 ----%",0);
 LCD_Write_word(2,48,"  小门全红:[ ]小门闪烁:[ ]%",0);
 LCD_Write_word(2,64,"  小门手动:[ ]灯号关闭:[ ]%",0);
 LCD_Write_word(2,80,"                            %",0);
 LCD_Write_word(2,96,"                            %",0);
 LCD_Write_word(2,112,"--------- [PgUp] ---------%",0);
//////////////////////////////////////////////////////
 Disp_Zimu(14,16,*ptr++);
 Disp_Zimu(26,16,*ptr++);
 Disp_Zimu(14,48,*ptr++);
 Disp_Zimu(26,48,*ptr++);
 Disp_Zimu(14,64,*ptr++);
 Disp_Zimu(26,64,*ptr);
///////////////////////////////////////////////////////
 LCD_Disp_Frame_S();
}
*/
////////////////////显示1位数数据函数///////////////////////////////////////
///////////////////在光标位置显示1位数字//////////////////////////////////
void Disp_Data_1(uchar LCM_x,uchar LCM_y,uchar m)
{
    switch(m%10)
	{
	 case 0: LCD_Write_word(LCM_x,LCM_y,"0%",0);
		     break;
     case 1: LCD_Write_word(LCM_x,LCM_y,"1%",0);
		     break;
     case 2: LCD_Write_word(LCM_x,LCM_y,"2%",0);         
		     break;
	 case 3: LCD_Write_word(LCM_x,LCM_y,"3%",0);
		     break;
     case 4: LCD_Write_word(LCM_x,LCM_y,"4%",0);
		     break;
     case 5: LCD_Write_word(LCM_x,LCM_y,"5%",0);         
		     break;
	 case 6: LCD_Write_word(LCM_x,LCM_y,"6%",0);
		     break;
     case 7: LCD_Write_word(LCM_x,LCM_y,"7%",0);
		     break;
     case 8: LCD_Write_word(LCM_x,LCM_y,"8%",0);         
		     break;
	 case 9: LCD_Write_word(LCM_x,LCM_y,"9%",0);
		     break;	
	}
}
////////////////////显示2位数数据函数///////////////////////////////////////
////////////////////从指定的光标位置开始显示2位数字/////////////////////////
void Disp_Data_2(uchar LCM_x,uchar LCM_y,uchar m)
{
  uchar a,b,i,h;
  a=m/10;
  b=m%10;
  for(i=0;i<2;i++)
   {
    if(i==0)  h=a;
	   else  {h=b; LCM_x=LCM_x+1;}
     switch(h)

⌨️ 快捷键说明

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