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

📄 showlcd.lst

📁 单片机的主控端
💻 LST
字号:
C51 COMPILER V7.09   SHOWLCD                                                               10/11/2006 16:32:11 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE SHOWLCD
OBJECT MODULE PLACED IN ShowLcd.OBJ
COMPILER INVOKED BY: e:\Keil\C51\BIN\C51.EXE ShowLcd.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include <regx52.h>
   2          #include "sys.h"
   3          #include "ShowLcd.h"
   4          
   5          data UCHAR show[6] = {0,0,0,0,0,0};//显示缓冲区
   6          
   7          float code GAINU[20]={0.0648,0.1041,0.0878,0.0654,0.0795,0.0939,0.0862,0.0776,1,1,1,1,1,1,1,1,1,1,1,1} ;//
             -板上电压部分增益
   8          float code GAINUb[20]={-2.0573,-2.6596,-5.4535,10.8055,-2.7239,-8.7887,-2.5181,-2.55,1,1,1,1,1,1,1,1,1,1,1
             -,1} ;
   9          float code GAINI[20]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} ;//板上电流部分增益
  10          
  11          extern UCHAR UIData[8];
  12          
  13          float Ufloat(float tmp)
  14          {
  15   1              if(tmp<0)
  16   1              {
  17   2                      return (-tmp);  
  18   2              }
  19   1              else 
  20   1              {
  21   2                      return tmp;
  22   2              }
  23   1      }
  24          
  25          void showFloat(UCHAR PP)
  26          {
  27   1          float result;
  28   1          //UINT showtmp=0;
  29   1      /*
  30   1         result = ( (int)((UIData[0]<<8)|UIData[1]) )/(UIData[2]&0xFF)*GAINI[PP
  31   1         ];   //UIData[2]&0xFF保持放大器增益不变,为-1,-2,-10
  32   1              if(UIData==10)
  33   1              {
  34   1                      result = -result;
  35   1              }
  36   1              if(result <=0)
  37   1              {
  38   1                      show[0]='-';    
  39   1              }
  40   1              else
  41   1              {
  42   1                      show[0]='+';
  43   1              }
  44   1              result = Ufloat(result);
  45   1      //      showtmp =(UINT)result;
  46   1          if(result<1)           //0.???
  47   1          {
  48   1              show[1] = '0';
  49   1              show[2] = '.';
  50   1              result *= 10;
  51   1              show[3] = '0'+((UCHAR)result % 10);
  52   1              result *= 10;
  53   1              show[4] = '0'+((UCHAR)result % 10);
C51 COMPILER V7.09   SHOWLCD                                                               10/11/2006 16:32:11 PAGE 2   

  54   1              result *= 10;
  55   1              show[5] = '0'+((UCHAR)result % 10);
  56   1          }   //if <1
  57   1          else if(result < 10)     // ?.???
  58   1              {
  59   1                  show[1] = '0'+((UCHAR)result % 10);
  60   1                  show[2] = '.';
  61   1                  result *= 10;
  62   1                  show[3] = '0'+((UCHAR)result % 10);
  63   1                  result *= 10;
  64   1                  show[4] = '0'+((UCHAR)result % 10);
  65   1                  result *= 10;
  66   1                  show[5] = '0'+((UCHAR)result % 10);
  67   1              }   // if 1<= <10
  68   1              else if(result < 100)    // ??.??
  69   1                  {
  70   1                      show[2] = '0'+((UCHAR)result % 10);
  71   1                      result *= 0.1;   //?.???
  72   1                      show[1] = '0'+((UCHAR)result % 10);
  73   1                      show[3] = '.';
  74   1                      result *= 100;  //???.?
  75   1                      show[4] = '0'+((UCHAR)result % 10);
  76   1                      result *= 10;   //????.
  77   1                      show[5] = '0'+((UCHAR)result % 10);
  78   1                  }   //if 10<= <100
  79   1                  else if(result < 1000)   //???.?
  80   1                      {
  81   1                          show[3] = '0'+((UCHAR)result % 10);
  82   1                          show[4] = '.';
  83   1                          result *= 0.1;  //??.??
  84   1                          show[2] = '0'+((UCHAR)result % 10);
  85   1                          result *= 0.1;  //?.???
  86   1                          show[1] = '0'+((UCHAR)result % 10);
  87   1                          result *= 1000;
  88   1                          show[5] = '0'+((UCHAR)result % 10);
  89   1                      }   // if 100<= <1000
  90   1                      else if(result < 10000)  //????.
  91   1                          {
  92   1                              show[5] = '.';
  93   1                              show[4] = '0'+((UCHAR)result % 10);
  94   1                              result *= 0.1;  //???.?
  95   1                              show[3] = '0'+((UCHAR)result % 10);
  96   1                              result *= 0.1;  //??.??
  97   1                              show[2] = '0'+((UCHAR)result % 10);
  98   1                              result *= 0.1;  //?.???
  99   1                              show[1] = '0'+((UCHAR)result % 10);
 100   1                          }
 101   1          LCDString(19, show, 6); //show I
 102   1          LCDChar(18, 'I');
 103   1       */   
 104   1      
 105   1      
 106   1          result = ( (int)((UIData[3]<<8)|UIData[4]) )/(UIData[5]&0xFF)*GAINU[PP]-GAINU[PP];  //(UIData[5]&0x0F)

⌨️ 快捷键说明

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