C51 COMPILER V8.12   KEYPAD_CONTROLLED_LEDS                                                08/17/2013 10:53:06 PAGE 1   


C51 COMPILER V8.12, COMPILATION OF MODULE KEYPAD_CONTROLLED_LEDS
OBJECT MODULE PLACED IN keypad_controlled_leds.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE keypad_controlled_leds.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          // Project name : Keypad Controlled Leds
   2          // Designed By  : ROBOMART
   3          //                http://www.robomart.com
   4          
   5          /* Program for "Controlling Leds Using Keypad" 
   6          ___________________________________________________
   7          
   8          Connection settings of Kit
   9          
  10          8bit Keypad---@------------->P0
  11          
  12          LED---@------------->P2
  13          
  14          RESET-------------------------->PIN9
  15          Crystal Ossilator-------------->PIN18 and PIN19
  16          VCC=Regulated 5V
  17          Gnd=Ground(0V)
  18          */
  19          
  20            #include<reg52.h>
  21            void delay(unsigned int);
  22            sbit switch1 = P0^0;            // key 0 connected to P0^0
  23            sbit switch2 = P0^1;            // key 1 connected to P0^1
  24            sbit switch3 = P0^2;            // key 2 connected to P0^2
  25            sbit switch4 = P0^3;            // key 3 connected to P0^3
  26            sbit switch5 = P0^4;            // key 4 connected to P0^4
  27            sbit switch6 = P0^5;            // key 5 connected to P0^5
  28            sbit switch7 = P0^6;            // key 6 connected to P0^6
  29            sbit switch8 = P0^7;            // key 7 connected to P0^7
  30            void main(void)
  31            {
  32   1        switch1=1;
  33   1        switch2=1;
  34   1        switch3=1;
  35   1        switch4=1;
  36   1        switch5=1;                               // make all switch as input device
  37   1        switch6=1;
  38   1        switch7=1;
  39   1        switch8=1;
  40   1        P2=0x00;                                         // Port 2 as Output Device for LEDs
  41   1        while(1)
  42   1        {
  43   2        if(switch1==1)
  44   2        {
  45   3        P2=0x01;                                         // 1st Led will glow
  46   3        delay(200);
  47   3        P2=0x00;                                      //      Led will be off
  48   3         }                                               
  49   2        
  50   2        }
  51   1        }
  52          
  53          void delay(unsigned int time)
  54          { 
  55   1      unsigned int i,j;
C51 COMPILER V8.12   KEYPAD_CONTROLLED_LEDS                                                08/17/2013 10:53:06 PAGE 2   

  56   1      for(i=0;i<time;i++)
  57   1              for(j=0;j<1275;j++);
  58   1      }
  59          
  60          


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


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