#include<reg51.h>
#define uchar unsigned char
uchar dis[]={0xc0,0xf9,0xa4,0xb0,0xbf};
uchar keyval;
void delay(uchar a)
{
uchar i;
while(a--)for(i=0;i<120;i++);
}
main()
{
while(1)
{
keyval=P0&0x0f;
switch(keval)
{
case 0e:P1=dis[0];delay(100);break;
case 0d:P1=dis[1];delay(100);break;
case 0b:P1=dis[2];delay(100);break;
case 07:P1=dis[3];delay(100);break;
default:break;
}
}
}
追问EX1.C(16): error C202: 'keval': undefined identifier
EX1.C(18): error C281: illegal floating point constant
EX1.C(19): error C251: illegal octal digit
EX1.C(20): error C251: illegal octal digit
咋办