#include "reg51.h"
main()
{
void delay(int);
int i,j;
char seg[10]={0xc0,0xf9,0xa4,0xb0,0x99,
0x92,0x82,0xf8,0x80,0x90};
while(1)
{
for(i=0;i<9999;i++)//i不可字元
{
for(j=0;j<25;j++)
{
P2=0x07;
P1=seg[(i/1000)%10];
delay(200);P1=0XFF;
P2=0x0b;
P1=seg[(i/100)%10];
delay(200);P1=0XFF;
P2=0x0d;
P1=seg[(i/10)%10];
delay(100);P1=0XFF;
P2=0x0e;
P1=seg[(i/1)%10];
delay(200);P1=0XFF;
}
}
}
}
void delay(int count)
{
int i;
for(i=0;i<count;i++)
;
}
沒有留言:
張貼留言