Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <reg515.sfr>
  2. #include <lcd.h>
  3.  
  4.  void main()
  5.  {
  6.  unsigned char x;
  7.  unsigned int i, l=0;
  8.  lcd_init();
  9.  out_instr(0x01);
  10.  
  11.  while(1)
  12.  {
  13.  x=get_kb();
  14.  for(i=0;i<15000;i++);
  15.  if(x!='\0'&&x!='e')
  16.   out_char(x);
  17.  if(x>='0'&&x<='9')
  18.     l=l*10+((int)x-48);
  19.    
  20.  if(x=='e')
  21.  {
  22.   out_instr(0x01);
  23.   out_char(l);
  24.   l=0;
  25.  }
  26.  if(x=='b')
  27.  {
  28.     out_instr(0x01);
  29.     l=0;
  30.  }
  31.   // for(i=0;i<15000;i++);   
  32.  }
  33.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement