极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 8984|回复: 2

求助,如何让这段代码可以正常编译

[复制链接]
发表于 2013-8-12 18:40:07 | 显示全部楼层 |阅读模式
本帖最后由 碇源堂 于 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,也就是判断为假才能通过,但是。。。坑爹的是。。。不行啊。。。这个好像不能识别“!=”啊。。。肿么办?为什么会这样?
回复

使用道具 举报

发表于 2013-8-12 19:06:33 | 显示全部楼层
while(a!=11,b!=11,c!=11)改为while(a!=11&&b!=11&&c!=11)
回复 支持 反对

使用道具 举报

发表于 2013-8-12 19:08:23 | 显示全部楼层
if(a!=11,b!=11,c!=11)这句的“,”也要改为&&
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-6-4 01:21 , Processed in 0.042713 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表