文档详情

新版Arduino 语法手册.doc

发布:2018-10-02约5.84万字共123页下载文档
文本预览下载声明
天天开心 天天开心 Arduino 语法手册 Arduino 的程序可以划分为三个主要部分:结构、变量(变量与常量)、函数。 结构部分 一、结构 1.1 setup() 1.2 loop() 二、结构控制 2.1 if 2.2 if...else 2.3 for 2.4 switch case 2.5 while 2.6 do... while 2.7 break 2.8 continue 2.9 return 2.10 goto 三、扩展语法 3.1 ;(分号) 3.2 {}(花括号) 3.3 //(单行注释) 3.4 /* */(多行注释) 3.5 #define 3.6 #include 四、算数运算符 4.1 =(赋值运算符) 4.2 +(加) 4.3 -(减) 4.4 *(乘) 4.5 /(除) 4.6 %(模) 五、比较运算符 5.1 ==(等于) 5.2 !=(不等于) 5.3 (小于) 5.4 (大于) 5.5 =(小于等于) 5.6 =(大于等于) 六、布尔运算符 6.1 (与) 6.2 ||(或) 6.3 !(非) 七、指针运算符 7.1 * 取消引用运算符 7.2 引用运算符 八、位运算符 8.1 (bitwise and) 8.2 | (bitwise or) 8.3 ^ (bitwise xor) 8.4 ~ (bitwise not) 8.5 (bitshift left) 8.6 (bitshift right) 九、复合运算符 9.1 ++ (increment) 9.2 -- (decrement) 9.3 += (compound addition) 9.4 -= (compound subtraction) 9.5 *= (compound multiplication) 9.6 /= (compound division) 9.6 = (compound bitwise and) 9.8 |= (compound bitwise or) 变量部分 十、常量 10.1 HIGH|LOW(引脚电压定义) 10.2 INPUT|OUTPUT(数字引脚(Digital pins)定义) 10.3 true | false(逻辑层定义) 10.4 integer constants(整数常量) 10.5 floating point constants(浮点常量) 十一、数据类型 11.1 void 11.2 boolean(布尔) 11.3 char(有号数据类型) 11.4 unsigned char(无符号数据类型) 11.5 byte(无符号数) 11.6 int(整型) 11.7 unsigned int(无符号整型) 11.8 word 11.9 long(长整数型) 11.10 unsigned long(无符号长整数型) 11.11 float(浮点型数) 11.12 double(双精度浮点数) 11.13 string(char array/字符串) 11.14 String object(String类) 11.15 array (数组) 十二、数据类型转换 12.1 char() 12.2 byte() 12.3 int() 12.4 word() 12.5 long() 12.6 float() 十三、变量作用域 修饰符 13.1 variable scope(变量的作用域) 13.2 static(静态变量) 13.3 volatile 13.4 const 十四、辅助工具 14.1 sizeof() 函数部分 十五、数字 I/O 15.1 pinMode() 15.2 digitalWrite() 15.3 digitalRead() 十六、模拟 I/O 16.1 analogReference() 16.2 analogRead() 16.3 analogWrite() PWM 十七、高级 I/O 17.1 tone() 17.2 noTone() 17.3 shiftOut() 17.4 shiftIn() 17.5 pulseIn() 十八、时间 18.1 millis() 18.2 micros() 18.3 delay() 18.4 delayMicroseconds() 十九、数学运算 19.1 min() 19.2 max() 19.3 abs() 19.4 constrain() 19.5 map() 19.6 pow() 19.7 sqrt() 19.8 ceil() 19.9 exp() 19.10 fabs() 19.11 floor() 19.12 fma() 19.13 fmax() 19.14 fmin() 19.15 fm
显示全部
相似文档