以下程序,问题已标示,度娘说是CH1未定义,请帮忙看下如何解决,谢谢!
#include <reg52.h>
#define LED P0
sbit CH1=P2^0;
sbit CH2=P2^1;
unsigned char WEIMA[8]= {0x7f,0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf};
unsigned char DUANMA[8]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07};
void delay(void)
{
unsigned int i,j;
for(i=0;i<1000;i++)
for(j=0;j<1000;j++);
}
void main(void)
{
unsigned char m,n;
while(1)
{
for(m=0;m<=8;m++);
LED=WEIMA[m];
CH1=0;
CH2=1;
delay();
for(n=0;n<=8;n++);
LED=DUANMA[n]
CH1=1; //问题:error C141: syntax error near 'CH1'
CH2=0;
delay();
}
}
|