本帖最后由 碇源堂 于 2013-8-13 15:46 编辑
因为WIKI里介绍的资料太少,而我又急需使用,所以过来询问了~【强烈建议把有相关代码的教程链接到WIKI了,至少能让一些事情好查一点。。。】
while(a!=11,b!=11,c!=11)
{
if(13==HIGH){
a=s1+a;
if(13==HIGH){
b=s1+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;
}
else if(15==HIGH){
c=s3+c;
}
}
else if(14==HIGH){
b=s2=b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;
}
else if(15==HIGH){
c=s3+c;
}
}
else if(15==HIGH){
b=s3+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;
}
else if(15==HIGH){
c=s3+c;
}
}
}
else if(14==HIGH){
a=s2+a;
if(13==HIGH){
b=s1+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
else if(14==HIGH){
b=s2+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
else if(15==HIGH){
b=s3+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
}
else if(15==HIGH){
a=s3+a;
if(13==HIGH){
b=s1+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
else if(14==HIGH){
b=s2+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
else if(15==HIGH){
b=s3+b;
if(13==HIGH){
c=s1+c;
}
else if(14==HIGH){
c=s2+c;}
else if(15==HIGH){
c=s3+c;}
}
}
}
if(a!=11,b!=11,c!=11)
{
digitalWrite(16,LOW);
}
else
{
digitalWrite(16,HIGH);
}
delay(10000);//注意,这里是1000毫秒,等于1秒,自行决定电磁继电器开合持续时间,时间结束后,从新循环
}
这段代码的“while(a!=11,b!=11,c!=11)”部分被提示出错,我需要A和B还有C同时都等于11,也就是判断为假才能通过,但是。。。坑爹的是。。。不行啊。。。这个好像不能识别“!=”啊。。。肿么办?为什么会这样? |