关于单片机C语言编程流水灯的问题
#include<reg51.h>#include<intrins.h>#defineledP2;voiddelay(intz);intx,y,z;voidmain(vo...
#include<reg51.h>
#include<intrins.h>
#define led P2;
void delay(int z);
int x,y,z;
void main(void)
{
unsigned char n;
led=0xfe;
while(1)
{
for(n=0;n<7;n++)
{
led=_crol_(led,1);
delay(100);
}
}
}
void delay(int z)
{
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
编译时一直都显示这两种情况,不知道哪里有问题了求大神回答
KAO.C(9): warning C275: expression with possibly no effect
KAO.C(9): error C141: syntax error near '='
KAO.C(14): error C141: syntax error near '='
KAO.C(14): error C141: syntax error near ';' 展开
#include<intrins.h>
#define led P2;
void delay(int z);
int x,y,z;
void main(void)
{
unsigned char n;
led=0xfe;
while(1)
{
for(n=0;n<7;n++)
{
led=_crol_(led,1);
delay(100);
}
}
}
void delay(int z)
{
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
编译时一直都显示这两种情况,不知道哪里有问题了求大神回答
KAO.C(9): warning C275: expression with possibly no effect
KAO.C(9): error C141: syntax error near '='
KAO.C(14): error C141: syntax error near '='
KAO.C(14): error C141: syntax error near ';' 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询