E:\arduino\ANJIAN\ANJIAN.ino: In function 'void loop()':
ANJIAN:23:4: error: case label '2' not within a switch statement
case 2:
^~~~
ANJIAN:25:4: error: break statement not within loop or switch
break;
^~~~~
exit status 1
case label '2' not within a switch statement
在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。
case前需要加switch语句:
int a =1;
switch (a) { // 就是这里,条件语句
case 1:
// statements
break;
case 2:
// statements
break;
default:
// statements
break;
}