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

📄 44bmon.c

📁 智能短信终端
💻 C
📖 第 1 页 / 共 4 页
字号:
     int i=0;
     int j=0;
     Uart_Printf1("\nplese wait ...");
     
     lcd_printf(25,6,BLUE,"plese wait ...");
     

     
     while(borf)Delay(10);
     rINTMSK |=(BIT_URXD1);//关串口中断
     
     
     for(j=0;j<l;j++)
     
     {
     Uart_Printf2("at\n");    
     while(Uart_Getch2()!='K')Delay(1);
    //  {
   	//	 ch=Uart_Getch(); 
    //	 Uart_Sendch('\n');
    //	 Uart_Sendch(ch);
	//  } 
	
	 
	 Delay(500);
	 
     Uart_Printf2("at+cmgs=");//at+cmgs=
     Uart_SendData2(0x22);//////"
     Uart_Printf2("+86");///////+86
     Uart_Printf2(&hao[j][0]);
     Uart_SendData2(0x22);//////"
     
     Uart_SendData2(0x0d);//////回车
      
     while(Uart_Getch2()!='>')Delay(10);
     
     Delay(500);
     Uart_Printf2(xin);
     Uart_SendData2(0x1a);
     while(Uart_Getch2()!='K')Delay(1);
     
     
    }
    
    
    
    while(rUTRSTAT1 & 0x1) 		
	 ch=rURXH1;
	 
    	// Uart_Sendch1(ch);
    rI_ISPC |=0x040; 
    rINTMSK &=~BIT_URXD1;//开串1口中断	
    
     Uart_Printf1("\ninformation is ok!\n");
     
     for(i=25;i<=39;i++)
     lcd_printf(i,6,BLUE,0);
     
     
     lcd_printf(25,6,BLUE,"Information is ok!");
     Delay(5000);
}
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////

void tc35_Init(void)
{  
    int counter=0;
    int x=1;
    char chr=0;
    
    while(rUTRSTAT1 & 0x1) 		
	chr=rURXH1;
   
    lcd_printf(4,2,BLUE,"Huan ying shi yong , zhu ni yu kuai!");
    lcd_printf(8,4,BLUE,"plese wait, the system is initing...");
    Delay(50000);
    
    Uart_Printf1("\nplese wait, the system is initing...");
     while(x)
     {
     counter=0;
     Uart_Printf2("at\n");
     while((!(rUTRSTAT1 & 0x1))&&(counter<=1000))
     {
    
     Delay(10);
     counter++;
     }
     if(counter!=1001)
     {
     x=0;
     chr=rURXH1;
     }
     else x=1;
	 }
	 
	 Delay(50000);
     Uart_Printf2("at\n");
     while(Uart_Getch2()!='K')Delay(1);
     Delay(300000);
	
     
     Uart_Printf2("at+cnmi=2,1,0,0,1\n");
     while(Uart_Getch2()!='K')Delay(1);
    
     Lcd_Clr();
     lcd_printf(4,2,BLUE,"Huan ying shi yong , zhu ni yu kuai!");
     lcd_printf(8,4,BLUE,"system is inited !");
     Uart_Printf1("\nsystem is inited !\n");  
     Delay(500);
}  

////////////////////////////////////////////////////////////


void shuhao(void)
{   int i=1;
    int j=0;
    int k=0;
    
	char bf[20];
	l=0;
    Uart_Printf1("\nplesae input the number");
    
    xx=0;yy=0;
	Lcd_Clr();
	lcd_printf(xx,yy,BLUE,"Plesae input the number");
	yy++;
	xx=xx+2;
	lcd_printf(xx,yy,BLUE,"with Key On 4*4 Keyboard");
	yy++;
	lcd_printf(xx,yy,BLUE,"press 'f' to finish the case");
	yy=6;
	xx=10;
	lcd_printf(xx,yy,BLUE,"press any key to continue...");
	
	Uart_Printf1("\nwith Key On 4*4 Keyboard:");
	Uart_Printf1("\nand press f to finish the case:\n");
	
	

    while(!key) Delay(10);
	if(key!='c')
	key=0;
	else 
	return;/////////////返回 
	
	Lcd_Clr();
	
	lcd_printf(0,0,BLUE,"Your number:");
	xx=0;yy=2;
	fs=0;//启动光标显示
	
	
	for(j=0;j<20;j++) 
	{
	bf[j]=0x20;
	}
	j=0;
	

	while (i)
	{   
	    
	    
	    
	    
	    switch(key)
{
    case '5':	
           key=0;
           bf[j]='5';
           j=j+1;
           Uart_SendData1('5');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'5');
            
           break;   



   case '2':        
          
		   key=0;
           bf[j]='2';
           j=j+1;
           Uart_SendData1('2');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'2'); 
           break;					            


  case '3':
           key=0;
		   bf[j]='3';
		   j=j+1;
           Uart_SendData1('3');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'3'); 		
           break;
          
     case '4':

           key=0;
           bf[j]='4';
           j=j+1;
           Uart_SendData1('4');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'4'); 
           break;
    
     case '6':
           key=0;
           bf[j]='6';
           j=j+1;
           Uart_SendData1('6');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'6'); 
           break;

     case '7': 
           key=0;
           bf[j]='7';
           j=j+1;
           Uart_SendData1('7');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'7'); 
           break;
           
    case '8': 
           key=0;
           bf[j]='8';
           j=j+1;
           Uart_SendData1('8');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'8'); 
           break;
    
    case '9':      
           key=0;
           bf[j]='9';
           j=j+1;
           Uart_SendData1('9');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'9'); 
           break;
  case '0':
           key=0;
           bf[j]='0';
           j=j+1;
           Uart_SendData1('0');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'0'); 
           break;         
          
 case '1':
           key=0;
           bf[j]='1';
           j=j+1;
           Uart_SendData1('1');
           //
			while(fs) Delay(1);
			if(xx<=38) xx++;
			else {xx=0;yy++;}
			lcdchar(xx,yy,RED,'1'); 
           break; 
 case 'd':          //back space   back space   back space   back space
                     key=0;
                     j=j-1;           
                     Uart_SendData1(0x08);
					 Uart_SendData1(' ');
                     Uart_SendData1(0x08);
                     //
                     while(fs) Delay(1);
					 lcdchar(xx,yy,RED,0);
					 if(xx>=1)xx--;
					 else {yy--;xx=39;}
            break;






case  'e': 
                   key=0;

                   bf[j]=0;
                   for(k=0;k<=j;k++)
                   hao[l][k]=bf[k];
                   j=0;
                   l++;
                  
                   while(fs) Delay(1);
                   xx=0;
                   yy++;
                  break;
        

case  'f':
                
                     key=0;
                     i=0; 
       break; 

case  'c':
                
                    return; 
       break; 

case 0:
           break;
 default:           
           key=0;
           Uart_Printf1("\nsorry you touch an wrrong key\n");
           break;

}
}	
           
           xx=0;yy++;
           lcd_printf(xx,yy,BLUE,"ok");
           Delay(500);

}
//////////////////////////////////////////////////////////////////
void haoshuru(void)
{   int i=1;
    int j=0;
    while(i)
{    
     if(key=='c')
     return;
     shuhao();
     
     if(key=='c')
     return;
     
     
     fs=10;//取消光标
     Lcd_Clr();
	 lcd_printf(0,0,BLUE,"This is the number you just input");
	 
	 for(j=0;j<l;j++)
	 lcd_printf(2,j+1,BLUE,&hao[j][0]);
	 
	 lcd_printf(0,6,BLUE,"If sure : push 'a' else push 'b'");
     
     
     Uart_Printf1("\nthis is the number you just input\n");
     Uart_Printf1(hao);
     Uart_Printf1("\nIf sure : push 'a'\nelse push 'b'\n");
     while(!key)Delay(10);
     if(key=='a')
     {
     key=0;
     i=0;
     }
     else
     {
     if(key!='c')
     key=0;
     else 
     return;
     }
}     
} 

////////////////////////////////////////////////////////////////////
void xinbianji(void)
{   int i=1;
    while(i)
{
     bianji();
     if(key=='c')
     return;
     
     Uart_Printf1("\nthis is what you just edit\n");
     
     fs=10;//取消光标
     Lcd_Clr();
	 lcd_printf(0,0,BLUE,"This is what you just edit");
	 lcd_printf(2,1,BLUE,xin);
	 lcd_printf(0,6,BLUE,"If sure : push 'a' else push 'b'");
	 
	
	
     Uart_Printf1(xin);
     Uart_Printf1("\nIf sure : push 'a'\nelse push 'b'\n");
     while(!key)Delay(10);
     if(key=='a')
     {
     key=0;
     i=0;
     }
     else
     {
     if(key=='c')
     return;
     else
     key=0;
     }
}     
} 
///////////////////////////////////////////////////////////////////////
void bianji(void)
{   
    int i=1;
    
    int k=0;
	char bf[120];
	j=0;
	xx=0;
	yy=0;
	for(j=0;j<120;j++) 
	{
	bf[j]=0x20;
	}
	j=0;
	
	Lcd_Clr();
	lcd_printf(xx,yy,BLUE,"Plesae input the short informantion");
	yy++;
	xx=xx+2;
	lcd_printf(xx,yy,BLUE,"with Key On 4*4 Keyboard");
	yy++;
	lcd_printf(xx,yy,BLUE,"press 'f' to finish the case");
	yy=6;
	xx=10;
	lcd_printf(xx,yy,BLUE,"press any key to continue...");
	
	
	Uart_Printf1("\nplesae input the short informantion");
	Uart_Printf1("\nwith Key On 4*4 Keyboard:");
	Uart_Printf1("\nand press f to finish the case:\n");
	while(!key) Delay(10);
	if(key!='c')
	key=0;
	else 
	  return;
	
	
///////////////////////////////////////////////扫描键盘	
    Lcd_Clr();
    fs=0;/////启动光标显示
    xx=0;yy=0;
    lcd_printf(xx,yy,BLUE,"Your message:");
    yy++;
    xx=2;
	while (i)
	{   
	    
	    
	    
	    
	    switch(key)
{
    case '5':	
           key=0;
           switch(charfu)
		{
		       
					case 'j':
					            bf[j]='k';charfu='k';
					            
					            Uart_SendData1(0x08);
					            Uart_SendData1('k');
					            //
					            while(fs) Delay(1);
					            lcdchar(xx,yy,RED,0);
					            lcdchar(xx,yy,RED,'k');  
					            break;
					case 'k':
					            bf[j]='l';charfu='l';
					            
					            Uart_SendData1(0x08);
					            Uart_SendData1('l'); 
					            //
					            while(fs) Delay(1);
					            lcdchar(xx,yy,RED,0);
					            lcdchar(xx,yy,RED,'l'); 
					            break;
					
					case 'l':
					            bf[j]='j';charfu='j';
					            
					            Uart_SendData1(0x08);
					            Uart_SendData1('j');
					            //
					            while(fs) Delay(1);
					            lcdchar(xx,yy,RED,0);
					            lcdchar(xx,yy,RED,'j');
					            break;
					case 0x20:  
					            bf[j]='j';charfu='j';
					            
					            Uart_SendData1(0x08);
					            Uart_SendData1('j');
					            //
					            while(fs) Delay(1);
					            lcdchar(xx,yy,RED,0);
					            lcdchar(xx,yy,RED,'j');
					            break;

					

⌨️ 快捷键说明

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