C51 COMPILER V6.20c  MAIN                                                                  01/23/2016 23:45:03 PAGE 1   


C51 COMPILER V6.20c, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\Main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE .\Main.c DEBUG OBJECTEXTEND

stmt level    source

   1          
   2          #include <AT89x51.h>
   3          #include <stdio.h>
   4          #include "ADC0831.h"
   5          #include "lcd4bit.h"
   6          
   7          void InitSystem()
   8          {
   9   1      	InitADC0831();
  10   1      	init_lcd();
  11   1      	gotoxy_lcd(1, 1);
  12   1      	print_lcd("ADC0831 To 8051 ");
  13   1      }
  14          
  15          void main()
  16          {
  17   1      	unsigned char i;
  18   1      	unsigned char Msg[20];
  19   1      	unsigned int AverageValue;
  20   1      	unsigned char Sample[5] = {0, 0, 0, 0, 0};
  21   1      
  22   1      	InitSystem();
  23   1      	while(1)
  24   1      	{
  25   2      		AverageValue = 0;
  26   2      		for(i = 4; i > 0; i --)
  27   2      		{
  28   3      			Sample[i] = Sample[i - 1];
  29   3      			AverageValue += Sample[i];
  30   3      		}
  31   2      		Sample[0] = ReadADC0831();
  32   2      		AverageValue += Sample[0];
  33   2      		AverageValue /= 5;
  34   2      		sprintf(Msg, "   ADC = %d      \0", AverageValue);
  35   2      		gotoxy_lcd(1, 2);
  36   2      		print_lcd(Msg);
  37   2      	}
  38   1      }
  39          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    150    ----
   CONSTANT SIZE    =     41    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      27
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
