#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
uchar code DSY_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void delayms(uint x)
{
uchar i;
while(x--)
for(i=0;i<120;i++);
}
void main()
{
uchar k,m=0x80;
P0=0xff;
P2=0x00;
while(1)
{
for(k=0;k<8;k=++)//这里提示c141:syntax error near是什么意思我是按照书上写的怎么会有问题呢望高人指点一下
{
m=_crol_(m,1);
P2=m;
P0=DSY_CODE[k+1];
delayms(2);
}
}
}
|