Advertisement
eddiehy

Untitled

Nov 10th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<AT89X51.H>
  2.  
  3. unsigned char segcode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8
  4. ,0x80,0x90,0x88,0x83,0xa7,0xa1,0x86,0x8e};
  5.  
  6. void delay1m(unsigned int dly)
  7. {
  8. unsigned char count;
  9. while(dly!=0)
  10. {
  11. count=120;
  12. while(count>0)
  13. count--;
  14. dly--;
  15. }
  16. }
  17.  
  18. void main(void)
  19. {
  20. unsigned char i;
  21. i=0;
  22.  
  23. while(1)
  24. {
  25. delay1m(3750);
  26. P1=segcode[i];
  27. P2=segcode[i];
  28. P3=segcode[i];
  29. P0=segcode[i];
  30. i=i+1;
  31. if(i==16)
  32. i=0;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement