Arduino语法手册Arduino的程序可以划分为三个主要部分:结构、变量(变量与常量)、函数
结构部分一、结构1
1setup()1
2loop()二、结构控制2
4switchcase2
5while2
while2
7break2
8continue2
9return2
10goto三、扩展语法3
1;(分号)3
2{}(花括号)3
3//(单行注释)3
4/**/(多行注释)3
5#define3
6#include四、算数运算符4
1=(赋值运算符)4
2+(加)4
3-(减)4
4*(乘)4
5/(除)4
6%(模)五、比较运算符5
1==(等于)5
=(不等于)5
3(大于)5
5=(大于等于)六、布尔运算符6
1&&(与)6
2||(或)6
(非)七、指针运算符7
1*取消引用运算符7
2&引用运算符八、位运算符8
1&(bitwiseand)8
2|(bitwiseor)8
3^(bitwisexor)8
4~(bitwisenot)8
5(bitshiftright)九、复合运算符9
1++(increment)9
2--(decrement)9
3+=(compoundaddition)9
4-=(compoundsubtraction)9
5*=(compoundmultiplication)9
6/=(compounddivision)9
6&=(compoundbitwiseand)9
8|=(compoundbitwiseor)变量部分十、常量10
1HIGH|LOW(引脚电压定义)10
2INPUT|OUTPUT(数字引脚(Digitalpins)定义)10
3true|false(逻辑层定义)10
4integerconstants(整数常量)10
5floatingpoi