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

📄 define.lst

📁 此为一个详细的程序源代码 由单片机PIC16F873检测电平
💻 LST
字号:
     1: #include "define.h"
     2: #include <pic.h>
     3: bit ADFlag;
     4: bit ShutFlag,PowerFlag;
     5: bit ErrorFlag,WarnFlag,PowerLowFlag;
     6: bit MENU_Flag,SonMenuFlag;
     7: //bit key_UP_DOEN_Flag;
     8: 
     9: uchar UPDOWN;                   //菜单设置
    10: uchar ShowFlag;                 //显示内容
    11: uchar Secret;                   //密码
    12: uchar PowerInCount;
    13: 
    14: union I_C
    15: {
    16:         uint Int;
    17:         uchar Char[2];
    18: }Adresult_Vol,Adresult_Power;
    19: 
    20: uint AD,ADi; //处理计算的临时变量
    21: 
    22: uint dianya,nongdu;
    23: 
    24: uchar Zero,WarnPoint,Liangcheng;                //存储在EEPROM里面的数值
    25: union I_C Biaoding;
    26: uchar Danwei;
    27: 
    28: uchar KEYCOUNT;
    29: 
    30: uchar ini_time;         //初始化时钟,20s
    31: uchar time_Light_Count;
    32: uchar time_Return;
    33: uchar time_Menu_Flag;
    34: uchar timeCount;        //定时中断计数,4ms*250一个周期
    35: persistent uchar Time_Second,Time_Min,Time_Hour;        //时钟
    36: persistent uchar Time_Day,Time_Month,Time_Year;
    37: 
    38: 
    39: void Show_Warn()
    40: {
    41:         uchar i;
    42:         DATA = Addr_LCD_Top;    
    43:         Enable();       
    44:         for(i=0;i<8;i++)
    45:                 WriteLCD(TOP_POINT[i]);
    46:         Bottom[0]=Bottom[1]=Bottom[2]=Bottom[5]=Bottom[6]=Bottom[7]= ' ';
    47:         Bottom[3]=0x30+WarnPoint/10;
    48:         Bottom[4]=0x30+WarnPoint%10;
    49:                                                 
    50:         DATA = Addr_LCD_Bottom;
    51:         Enable();                       
    52:         for(i=0;i<8;i++)                
    53:                 WriteLCD(Bottom[i]);
    54: }
    55: void Show_Liangcheng()
    56: {
    57:         uchar i;
    58:         DATA = 0x01;
    59:         Enable();
    60:                                                                 
    61:         DATA = Addr_LCD_Top+1;
    62:         Enable();
    63:                                                                 
    64:         for(i=2;i<7;i++)
    65:         {
    66:                 WriteLCD(MENU_6[i]);
    67:         }
    68:                                                                 
    69:         DATA = Addr_LCD_Bottom+2;
    70:         Enable();
    71:                                                                 
    72:         Bottom[0]=Liangcheng>=100?(0x30+Liangcheng/100):' ';
    73:         Bottom[1]=Liangcheng>=10?(0x30+Liangcheng/10%10):' ';
    74:         Bottom[2]=Liangcheng%10+0x30;
    75:         for(i=0;i<3;i++)
    76:                 WriteLCD(Bottom[i]);
    77: }
    78: void Show_Time()
    79: {
    80:         uchar  i;
    81:         DATA = Addr_LCD_Top;    
    82:         Enable();       
    83: 
    84:         Top[0]=0x30+Time_Year/10;
    85:         Top[1]=0x30+Time_Year%10;
    86:         Top[2]='-';
    87:         Top[3]=0x30+Time_Month/10;
    88:         Top[4]=0x30+Time_Month%10;
    89:         Top[5]='-';
    90:         Top[6]=0x30+Time_Day/10;
    91:         Top[7]=0x30+Time_Day%10;        
    92:         for(i=0;i<8;i++)
    93:         WriteLCD(Top[i]);
    94: 
    95:         Bottom[0]=0x30+Time_Hour/10;
    96:         Bottom[1]=0x30+Time_Hour%10;
    97:         Bottom[2]=':';
    98:         Bottom[3]=0x30+Time_Min/10;
    99:         Bottom[4]=0x30+Time_Min%10;
   100:         Bottom[5]=':';
   101:         Bottom[6]=0x30+Time_Second/10;
   102:         Bottom[7]=0x30+Time_Second%10;
   103:         DATA = Addr_LCD_Bottom;
   104:         Enable();                       
   105:         for(i=0;i<8;i++)                
   106:                 WriteLCD(Bottom[i]);
   107: }
   108: 

⌨️ 快捷键说明

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