Arduino语法参考:修訂版本之間的差異

出自YFRobotwiki
跳轉到: 導覽搜尋
Arduino编程语法参考
Arduino编程语法参考
第 22 行: 第 22 行:
 
*[[; (分号)]]
 
*[[; (分号)]]
 
*[[大括号|{} (大括号)]]
 
*[[大括号|{} (大括号)]]
*[[注释| // (单行注释) ]]
+
*[[注释| //   (单行注释) ]]
*[[注释| /* */ (多行注释)]]
+
*[[注释| /**/(多行注释)]]
 
*[[ define|#define ]]
 
*[[ define|#define ]]
 
*[[ include |#include ]]
 
*[[ include |#include ]]
第 67 行: 第 67 行:
 
<font color="orange" size="+1">'''变量'''</font><br>
 
<font color="orange" size="+1">'''变量'''</font><br>
 
<font color="orange" >'''常量'''</font>
 
<font color="orange" >'''常量'''</font>
*[[常量|<nowiki>HIGH | LOW</nowiki>]]
+
*[[常量|HIGH]]|[[常量|LOW]]
*[[常量|INPUT | OUTPUT | INPUT_PULLUP]]
+
*[[常量|INPUT]]|[[常量|OUTPUT]]|[[常量|INPUT_PULLUP]]
 
*[[常量|LED_BUILTIN]]
 
*[[常量|LED_BUILTIN]]
*[[常量|true|false]]
+
*[[常量|true]]|[[常量|false]]
*[[integer constants]]
+
*[[integer constants (整型常量)]]
*[[floating point constants]]
+
*[[floating point constants (浮点型常量)]]
 +
<font color="orange" >'''数据类型'''</font>
 +
*[[void]]
 +
*[[boolean]]
 +
*[[char]]
 +
*[[unsigned char]]
 +
*[[byte]]
 +
*[[int]]
 +
*[[unsigned int]]
 +
*[[word]]
 +
*[[long]]
 +
*[[unsigned long]]
 +
*[[short]]
 +
*[[float]]
 +
*[[double]]
 +
*[[string]]-char array
 +
*[[string]]-object
 +
*[[array]]
 +
<font color="orange" >'''数据类型转换'''</font>
 +
*[[char()]]
 +
*[[byte()]]
 +
*[[int()]]
 +
*[[word()]]
 +
*[[long()]]
 +
*[[float()]]
 +
<font color="orange" >'''变量作用域'''</font>
 +
*[[variable scope]]
 +
*[[static]]
 +
*[[volatile]]
 +
*[[const]]
 +
<font color="orange" >'''辅助工具'''</font>
 +
*[[sizeof()]]
 +
*[[PROGMEM]]
 +
 
 
|width="33%" valign="top" align="left"|
 
|width="33%" valign="top" align="left"|
 
<font color="orange" size="+1">'''函数'''</font><br>
 
<font color="orange" size="+1">'''函数'''</font><br>
<font color="orange" >'''数 '''</font>
+
<font color="orange" >'''数 字I/O'''</font>
 
*[[pinMode()]]
 
*[[pinMode()]]
 
*[[digitalWrite()]]
 
*[[digitalWrite()]]
 
*[[digitalRead()]]
 
*[[digitalRead()]]
 +
<font color="orange" >'''模拟I/O'''</font>
 +
*[[analogReference()]]
 +
*[[analogRead()]]
 +
*[[analogWrite()]] - PWM
 +
<font color="orange" >'''只适用于Due & Zero板'''</font>
 +
*[[analogReadResolution()]]
 +
*[[analogWriteResolution()]]
 +
<font color="orange" >'''高级I/O'''</font>
 +
*[[tone()]]
 +
*[[noTone()]]
 +
*[[shiftOut()]]
 +
*[[shiftIn()]]
 +
*[[pulseIn()]]
 +
<font color="orange" >'''时间'''</font>
 +
*[[millis()]]
 +
*[[micros()]]
 +
*[[delay()]]
 +
*[[delayMicroseconds()]]
 +
<font color="orange" >'''数学'''</font>
 +
*[[min()]]
 +
*[[max()]]
 +
*[[abs()]]
 +
*[[constrain()]]
 +
*[[map()]]
 +
*[[pow()]]
 +
*[[sqrt()]]
 +
<font color="orange" >'''三角函数'''</font>
 +
*[[sin()]]
 +
*[[cos()]]
 +
*[[tan()]]
 +
<font color="orange" >'''随机数'''</font>
 +
*[[randomSeed()]]
 +
*[[random()]]
 +
<font color="orange" >'''位操作'''</font>
 +
*[[lowByte()]]
 +
*[[highByte()]]
 +
*[[bitRead()]]
 +
*[[bitWrite()]]
 +
*[[bitSet()]]
 +
*[[bitClear()]]
 +
*[[bit()]]
 +
<font color="orange" >'''外部中断'''</font>
 +
*[[attachInterrupt()]]
 +
*[[detachInterrupt()]]
 +
<font color="orange" >'''中断'''</font>
 +
*[[interrupts()]]
 +
*[[noInterrupts()]]
 +
<font color="orange" >'''串口通信'''</font>
 +
*[[Serial]]
 +
*[[Stream]]
 +
<font color="orange" >'''USB (仅适用于 基于芯片32u4的板和Due/Zero)'''</font>
 +
*[[Keyboard]]
 +
*[[Mouse]]
 +
 
|}
 
|}

2015年6月4日 (四) 11:24的修訂版本

Arduino官方語法參考

Arduino編程語法參考

結構

控制結構

擴展語法

算術運算符

比較運算符

布爾運算符

指針運算符

位運算符

複合運算符

變量
常量

數據類型

數據類型轉換

變量作用域

輔助工具

函數
數字I/O

模擬I/O

只適用於Due & Zero板

高級I/O

時間

數學

三角函數

隨機數

位操作

外部中斷

中斷

串口通信

USB (僅適用於 基於芯片32u4的板和Due/Zero)