“Arduino”的版本间的差异
Zhangfengfeng(讨论 | 贡献) |
17310559055(讨论 | 贡献) |
||
(未显示3个用户的12个中间版本) | |||
第1行: | 第1行: | ||
− | {|border="0" cellpadding="10" width=" | + | {|border="0" cellpadding="10" width="90%" |
|- | |- | ||
− | ==下载安装== | + | =='''下载安装'''== |
− | {| | + | {| style="width: 90%;" |
|- | |- | ||
− | | | + | |style="text-align: left"|[[File:IDE for Windows.png|400px|link=Getting started: Windows/zh]] |
− | [[File:IDE for | + | |style="text-align: left"|[[File:IDE for Mac.png|400px|link=Getting started: Mac/zh]] |
+ | |- | ||
+ | |style="text-align: center"| | ||
[[Getting started: Windows/zh| Windows版]] | [[Getting started: Windows/zh| Windows版]] | ||
− | | | + | |style="text-align: center"| |
− | |||
[[Getting started: Mac/zh| Mac版]] | [[Getting started: Mac/zh| Mac版]] | ||
− | |||
|} | |} | ||
− | ==语法手册 | + | =='''语法手册''' == |
− | + | {| style="width: 90%;" | |
− | |||
− | |||
− | {| | ||
|- | |- | ||
− | + | | | |
− | + | ||
− | + | Arduino 的程序可以划分为三个主要部分:结构、变量(变量与常量)、函数 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{| border="0" cellpadding="10" width="100%" | {| border="0" cellpadding="10" width="100%" | ||
|- | |- | ||
− | |width=" | + | |width="30%" valign="top" align="left"| |
− | *[[ | + | ===Structure/主结构=== |
− | *[[ | + | *[[setup()]] |
− | *[[ | + | *[[loop()]] |
− | *[[ | + | *Control Structures/控制结构 |
− | | | + | **[[if]] |
− | *[[ | + | **[[if...else]] |
− | *[[ | + | **[[for]] |
− | *[[ | + | **[[switch case]] |
− | *[[ | + | **[[while]] |
− | |width=" | + | **[[do... while]] |
− | *[[ | + | **[[break]] |
− | *[[ | + | **[[continue]] |
− | *[[ | + | **[[return]] |
− | *[[ | + | **[[goto]] |
− | |width=" | + | *Further Syntax/扩展语法 |
− | *[[ | + | **[[; (分号)]] |
− | *[[ | + | **[[花括号 |{} (花括号)]] |
− | + | **[[单行注释 |// (单行注释)]] | |
− | + | **[[/* */ (多行注释)]] | |
− | + | **[[define |#define]] | |
+ | **[[include|#include]] | ||
+ | *Arithmetic Operators/算数运算符 | ||
+ | **[[= (赋值)]] | ||
+ | **[[+ (加)]] | ||
+ | **[[- (减)]] | ||
+ | **[[* (乘)]] | ||
+ | **[[/ (除)]] | ||
+ | **[[% (模)]] | ||
+ | *Comparison Operators/比较运算符 | ||
+ | **[[== (等于)]] | ||
+ | **[[!= (不等于)]] | ||
+ | **[[小于 |< (小于)]] | ||
+ | **[[大于 |> (大于)]] | ||
+ | **[[小于或等于 |<= (小于或等于)]] | ||
+ | **[[大于或等于 |>= (大于或等于)]] | ||
+ | *Boolean Operators/布尔运算符 | ||
+ | **[[&& (与)]] | ||
+ | **[[或 ||| (或)]] | ||
+ | **[[! (非)]] | ||
+ | **Pointer Access Operators/指针运算符 | ||
+ | **[[* 取消引用运算符]] | ||
+ | **[[& 引用运算符]] | ||
+ | *Bitwise Operators/位运算符 | ||
+ | **[[& (按位与)]] | ||
+ | **[[按位或 | |(按位或)]] | ||
+ | **[[^ (按位异或)]] | ||
+ | **[[~ (按位取反)]] | ||
+ | **[[按位左移 |<< (按位左移)]] | ||
+ | **[[按位右移 |>> (按位右移)]] | ||
+ | *Compound Operators/符合运算符 | ||
+ | **[[++ (自加)]] | ||
+ | **[[-- (自减)]] | ||
+ | **[[+= (复合加)]] | ||
+ | **[[-= (复合减)]] | ||
+ | **[[*= (复合乘)]] | ||
+ | **[[/= (复合除)]] | ||
+ | **[[%= (复合取模)]] | ||
+ | **[[&= (复合按位与)]] | ||
+ | **[[复合位或 | |= (复合位或)]] | ||
+ | |width="30%" valign="top" align="left"| | ||
+ | ===Variables/变量=== | ||
+ | *Constants/常量 | ||
+ | **[[HIGH_LOW | HIGH | LOW]] | ||
+ | **[[INPUT_OUTPUT | INPUT | OUTPUT]] | ||
+ | **[[true_false | true | false]] | ||
+ | **[[整形常量]] | ||
+ | **[[浮点型常量]] | ||
+ | *Data Types/数据类型 | ||
+ | **[[void]] | ||
+ | **[[boolean]] | ||
+ | **[[char]] | ||
+ | **[[unsigned char]] | ||
+ | **[[byte]] | ||
+ | **[[int]] | ||
+ | **[[unsigned int]] | ||
+ | **[[word]] | ||
+ | **[[long]] | ||
+ | **[[unsigned long]] | ||
+ | **[[short]] | ||
+ | **[[float]] | ||
+ | **[[double]] | ||
+ | **[[string - char array]] | ||
+ | **[[String - object]] | ||
+ | **[[array]] | ||
+ | *Conversion/数据类型转换 | ||
+ | **[[char()]] | ||
+ | **[[byte()]] | ||
+ | **[[int()]] | ||
+ | **[[word()]] | ||
+ | **[[long()]] | ||
+ | **[[float()]] | ||
+ | *变量作用域 & 修饰符 | ||
+ | **[[变量作用域/variable scope]] | ||
+ | **[[静态变量/static]] | ||
+ | **[[易变变量/volatile]] | ||
+ | **[[常量变量/const]] | ||
+ | *Utilities/辅助工具 | ||
+ | **[[sizeof()]] | ||
+ | **[[ASCII码表]] | ||
+ | |width="30%" valign="top" align="left"| | ||
+ | ===Functions/函数=== | ||
+ | *Digital I/O /数字 I/O | ||
+ | **[[pinMode()]] | ||
+ | **[[digitalWrite()]] | ||
+ | **[[digitalRead()]] | ||
+ | *Analog I/O /模拟 I/O | ||
+ | **[[analogReference()]] | ||
+ | **[[analogRead()]] | ||
+ | **[[analogWrite() - PWM]] | ||
+ | *Advanced I/O /高级 I/O | ||
+ | **[[tone()]] | ||
+ | **[[noTone()]] | ||
+ | **[[shiftOut()]] | ||
+ | **[[shiftIn()]] | ||
+ | **[[pulseIn()]] | ||
+ | *Time/时间 | ||
+ | **[[millis()]] | ||
+ | **[[micros()]] | ||
+ | **[[delay()]] | ||
+ | **[[delayMicroseconds()]] | ||
+ | *Math/数学运算 | ||
+ | **[[min()]] | ||
+ | **[[max()]] | ||
+ | **[[abs()]] | ||
+ | **[[constrain()]] | ||
+ | **[[map()]] | ||
+ | **[[pow()]] | ||
+ | **[[sqrt()]] | ||
+ | *Trigonometry/三角函数 | ||
+ | **[[sin()]] | ||
+ | **[[cos()]] | ||
+ | **[[tan()]] | ||
+ | *Random Numbers/随机数 | ||
+ | **[[randomSeed()]] | ||
+ | **[[random()]] | ||
+ | *Bits and Bytes/位操作 | ||
+ | **[[lowByte()]] | ||
+ | **[[highByte()]] | ||
+ | **[[bitRead()]] | ||
+ | **[[bitWrite()]] | ||
+ | **[[bitSet()]] | ||
+ | **[[bitClear()]] | ||
+ | **[[bit()]] | ||
+ | *External Interrupts/外部中断函数 | ||
+ | **[[attachInterrupt()]] | ||
+ | **[[detachInterrupt()]] | ||
+ | *Interrupts/开关中断 | ||
+ | **[[interrupts()]] | ||
+ | **[[noInterrupts()]] | ||
+ | *Communication/通讯 | ||
+ | **[[Serial]] | ||
+ | **[[Stream]] | ||
|} | |} |