#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code sz[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
sbit P20=P2^0;
void delay(uint a)
{
uint i;
i=a;
while(i--);
}
void main()
{
P20=0;
uchar k;
while(1)
{
for(k=0;k<10;k++)
{
P0=sz[k];
delay(100);
}
}
}
除了这个错误还有我定义的K也提示错误。不理解,请大家指教 |