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

📄 main.lst

📁 单片机控制电机程序
💻 LST
字号:
C51 COMPILER V8.08   MAIN                                                                  03/18/2009 21:19:03 PAGE 1   


C51 COMPILER V8.08, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: D:\keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "aduc842.h"
   2          #include "Display.h"
   3          #include "stdio.h" 
   4          #include "ZLG7290.h"
   5          
   6             
   7          /***********************************************************
   8          函数:Delay()
   9          功能:延时
  10          ***********************************************************/
  11          /*void Delay(int n)
  12          {
  13                  int i=0;
  14                  while(n--)
  15                  {
  16                          for(i=0;i<5000;i++);
  17                  }       
  18          }               
  19             */
  20          /****************************************
  21          *函数名称:Serial_Init(void)
  22          *函数功能:串口初始化设置
  23          *输入参数:无
  24          *还 回 值:无
  25          *说    明:无
  26          ****************************************/
  27          void Serial_Init(void)  
  28          {
  29   1              PLLCON = 0x00;   //16.777MHz
  30   1              T3CON = 0x83;   
  31   1              T3FD = 0x09;
  32   1              SCON   = 0x052;
  33   1      }
  34          /****************************************
  35          *函数名称:unsigned int ADC(unsigned char channel)
  36          *函数功能:这里完成ADC的转换,共8个通道可以选择
  37          *输入参数:channel,通道选择参数    
  38          *还 回 值:(ADCDATAH&0x0F)*256+ADCDATAL,AD转换后的数字量
  39          *说    明:无
  40          ****************************************/
  41          unsigned int ADC(unsigned char channel)
  42          {
  43   1              ADCCON2 = channel;     //选择通道
  44   1              SCONV = 1;             //启动转换
  45   1              while(SCONV);          //等待转换完成
  46   1              return((ADCDATAH&0x0F)*256+ADCDATAL);         
  47   1      }
  48          
  49          /****************************************
  50          *函数名称:DAC0(unsigned int DaData)
  51          *函数功能:这里完成DAC0的转换
  52          *输入参数:DaData,送DA转换的数字量
  53          *还 回 值:无
  54          *说    明:无
  55          ****************************************/
C51 COMPILER V8.08   MAIN                                                                  03/18/2009 21:19:03 PAGE 2   

  56          void DAC0(unsigned int DaData)
  57          {
  58   1              DAC0H=DaData>>8;
  59   1              DAC0L=DaData;
  60   1      }
  61           
  62          /****************************************
  63          *函数名称:DAC1(unsigned int DaData)
  64          *函数功能:这里完成DAC1的转换
  65          *输入参数:DaData,送DA转换的数字量
  66          *还 回 值:无
  67          *说    明:无
  68          ****************************************/
  69          void DAC1(unsigned int DaData)
  70          {
  71   1              DAC1H=DaData>>8;
  72   1              DAC1L=DaData;
  73   1      }
  74          
  75          
  76          void delay(long N)
  77          {
  78   1        while(N!=0) N--;
  79   1      }
  80          
  81          
  82          
  83          /**********************************************************
  84          main函数
  85          ***********************************************************/
  86          void main()
  87          {
  88   1          Serial_Init();
  89   1          ADCCON1 = 0xAC;      //ADC上电,内部基准,clk 8分频
  90   1          DACCON = 0x1F;       //DAC采用内部ref做基准
  91   1                                   //这两个寄存器跟dac无关
  92   1              I2CCON = 0xa8;
  93   1              DispInit();             
  94   1              IT1 = 1;EX1 = 1;                                // ZLG7290中断方式
  95   1              EA = 1;
  96   1              DispClr(0,8);
  97   1      
  98   1      while(1)
  99   1      {       
 100   2        collect(); 
*** WARNING C206 IN LINE 100 OF MAIN.C: 'collect': missing function-prototype
 101   2      if(keyFlag)
 102   2      {
 103   3      //keyFlag = 0;
 104   3       u=KeyScan();
*** ERROR C202 IN LINE 104 OF MAIN.C: 'u': undefined identifier
 105   3      }
 106   2      if(u==1)
*** ERROR C202 IN LINE 106 OF MAIN.C: 'u': undefined identifier
 107   2      {
 108   3      num=100*num0+10*num1+num2;
*** ERROR C202 IN LINE 108 OF MAIN.C: 'num': undefined identifier
 109   3      ZLG7290_SegOnOff(38,0);
 110   3      }
 111   2      if(u==2)
*** ERROR C202 IN LINE 111 OF MAIN.C: 'u': undefined identifier
 112   2      {
C51 COMPILER V8.08   MAIN                                                                  03/18/2009 21:19:03 PAGE 3   

 113   3      num=0-(100*num0+10*num1+num2);
*** ERROR C202 IN LINE 113 OF MAIN.C: 'num': undefined identifier
 114   3      ZLG7290_SegOnOff(38,1);
 115   3      }
 116   2      if(u==3)
*** ERROR C202 IN LINE 116 OF MAIN.C: 'u': undefined identifier
 117   2         {      
 118   3              num0++;
*** ERROR C202 IN LINE 118 OF MAIN.C: 'num0': undefined identifier
 119   3          if(num0>9)
*** ERROR C202 IN LINE 119 OF MAIN.C: 'num0': undefined identifier
 120   3              num0=0;
*** ERROR C202 IN LINE 120 OF MAIN.C: 'num0': undefined identifier
 121   3          //ZLG7290_Download(5,0,0,num0);
 122   3          display(num0,num1,num2);
*** ERROR C202 IN LINE 122 OF MAIN.C: 'num0': undefined identifier
 123   3         }
 124   2      if(u==4)
*** ERROR C202 IN LINE 124 OF MAIN.C: 'u': undefined identifier
 125   2         {
 126   3               num1++;
*** ERROR C202 IN LINE 126 OF MAIN.C: 'num1': undefined identifier
 127   3           if(num1>9)
*** ERROR C202 IN LINE 127 OF MAIN.C: 'num1': undefined identifier
 128   3           num1=0;
*** ERROR C202 IN LINE 128 OF MAIN.C: 'num1': undefined identifier
 129   3          //ZLG7290_Download(6,1,0,num1);
 130   3           display(num0,num1,num2);
*** ERROR C202 IN LINE 130 OF MAIN.C: 'num0': undefined identifier
 131   3         }
 132   2      if(u==5)
*** ERROR C202 IN LINE 132 OF MAIN.C: 'u': undefined identifier
 133   2         {
 134   3              num2++;
*** ERROR C202 IN LINE 134 OF MAIN.C: 'num2': undefined identifier
 135   3          if(num2>9)
*** ERROR C202 IN LINE 135 OF MAIN.C: 'num2': undefined identifier
 136   3              num2=0;
*** ERROR C202 IN LINE 136 OF MAIN.C: 'num2': undefined identifier
 137   3          //ZLG7290_Download(7,0,0,num2);
 138   3         display(num0,num1,num2);
*** ERROR C202 IN LINE 138 OF MAIN.C: 'num0': undefined identifier
 139   3         }
 140   2         if(u==6)
*** ERROR C202 IN LINE 140 OF MAIN.C: 'u': undefined identifier
 141   2         {
 142   3           num0=0;
*** ERROR C202 IN LINE 142 OF MAIN.C: 'num0': undefined identifier
 143   3               num1=0;num2=0;
*** ERROR C202 IN LINE 143 OF MAIN.C: 'num1': undefined identifier
*** ERROR C202 IN LINE 143 OF MAIN.C: 'num2': undefined identifier
 144   3               num=0;
*** ERROR C202 IN LINE 144 OF MAIN.C: 'num': undefined identifier
 145   3              ZLG7290_SegOnOff(38,0);
 146   3               display(num0,num1,num2);
*** ERROR C202 IN LINE 146 OF MAIN.C: 'num0': undefined identifier
 147   3              }
 148   2      
 149   2         while(u==7)
*** ERROR C202 IN LINE 149 OF MAIN.C: 'u': undefined identifier
 150   2         {
 151   3          if(keyFlag)
C51 COMPILER V8.08   MAIN                                                                  03/18/2009 21:19:03 PAGE 4   

 152   3              {
 153   4              keyFlag=0;
 154   4              u0=KeyScan();
*** ERROR C202 IN LINE 154 OF MAIN.C: 'u0': undefined identifier
 155   4              }
 156   3              if(u0==6)
*** ERROR C202 IN LINE 156 OF MAIN.C: 'u0': undefined identifier
 157   3              {
 158   4              u=0;
*** ERROR C202 IN LINE 158 OF MAIN.C: 'u': undefined identifier
 159   4              num0=0;
*** ERROR C202 IN LINE 159 OF MAIN.C: 'num0': undefined identifier
 160   4              num1=0;
*** ERROR C202 IN LINE 160 OF MAIN.C: 'num1': undefined identifier
 161   4              num2=0;
*** ERROR C202 IN LINE 161 OF MAIN.C: 'num2': undefined identifier
 162   4              num=0;
*** ERROR C202 IN LINE 162 OF MAIN.C: 'num': undefined identifier
 163   4          }
 164   3      collect();
 165   3          if(num-da>=5)                                        
*** ERROR C202 IN LINE 165 OF MAIN.C: 'num': undefined identifier
 166   3                {
 167   4                //forward();
 168   4                 back();
 169   4                 delay(65535);
 170   4                 stop();
 171   4      
 172   4                }                             
 173   3              if(da-num>=5)
 174   3                {
 175   4                  //back();
 176   4                      forward();
 177   4                 delay(65535);
 178   4                 stop();
 179   4      
 180   4                }        
 181   3              if(num-da<5&&da-num<5)
 182   3                {
 183   4                 stop();
 184   4            }
 185   3         }
 186   2         }
 187   1      }
 188          

C51 COMPILATION COMPLETE.  1 WARNING(S),  35 ERROR(S)

⌨️ 快捷键说明

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