Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<AT89X51.H>
- unsigned char segcode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8
- ,0x80,0x90,0x88,0x83,0xa7,0xa1,0x86,0x8e};
- void delay1m(unsigned int dly)
- {
- unsigned char count;
- while(dly!=0)
- {
- count=120;
- while(count>0)
- count--;
- dly--;
- }
- }
- void main(void)
- {
- unsigned char i;
- i=0;
- while(1)
- {
- delay1m(3750);
- P1=segcode[i];
- P2=segcode[i];
- P3=segcode[i];
- P0=segcode[i];
- i=i+1;
- if(i==16)
- i=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement