用户工具

站点工具


reference:language:main

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

reference:language:main [2015/10/08 03:21]
弘毅
reference:language:main [2017/04/07 10:03]
行 1: 行 1:
-====== 语法手册 ====== 
- 
-Ocrobot 的程序可以划分为三个主要部分:**结构**、**变量**(变量与常量)、**函数**。 
- 
-===== 结构部分 ===== 
- 
-  *[[zh:​reference:​language:​setup|setup()]] 
-  *[[zh:​reference:​language:​loop|loop()]] 
- 
-=== 结构控制 === 
- 
-  *[[zh:​reference:​language:​if|if]] 
-  *[[zh:​reference:​language:​else|if...else]] 
-  *[[zh:​reference:​language:​for|for]] 
-  *[[zh:​reference:​language:​switchcase|switch case]] 
-  *[[zh:​reference:​language:​while|while]] 
-  *[[zh:​reference:​language:​dowhile|do... while]] 
-  *[[zh:​reference:​language:​break|break]] 
-  *[[zh:​reference:​language:​continue|continue]] 
-  *[[zh:​reference:​language:​return|return]] 
-  *[[zh:​reference:​language:​goto|goto]] 
- 
-=== 扩展语法 === 
- 
-  *[[zh:​reference:​language:​semicolon|;​(分号)]] 
-  *[[zh:​reference:​language:​braces|{}(大括号)]] 
-  *[[zh:​reference:​language:​comments|//​(单行注释)]] 
-  *[[zh:​reference:​language:​comments|/​* */​(多行注释)]] 
-  *[[zh:​reference:​language:​define|#​define]] 
-  *[[zh:​reference:​language:​include|#​include]] 
- 
-=== 算数运算符 === 
- 
-  * [[zh:​reference:​language:​assignment_operator|=(赋值运算符)]] 
-  * [[zh:​reference:​language:​arithmetic|+(加)]] 
-  * [[zh:​reference:​language:​arithmetic|-(减)]] 
-  * [[zh:​reference:​language:​arithmetic|*(乘)]] 
-  * [[zh:​reference:​language:​arithmetic|/​(除)]] 
-  * [[zh:​reference:​language:​modulo|%(模)]] 
- 
-=== 比较运算符 === 
- 
-  * [[zh:​reference:​language:​if|==(等于)]] 
-  * [[zh:​reference:​language:​if|!=(不等于)]] 
-  * [[zh:​reference:​language:​if|<​(小于)]] 
-  * [[zh:​reference:​language:​if|>​(大于)]] 
-  * [[zh:​reference:​language:​if|<​=(小于等于)]] 
-  * [[zh:​reference:​language:​if|>​=(大于等于)]] 
- 
-=== 布尔运算符 === 
- 
-  * [[zh:​reference:​language:​boolean|&&​(与)]] 
-  * [[zh:​reference:​language:​boolean|||(或)]] 
-  * [[zh:​reference:​language:​boolean|!(非)]] 
- 
-=== 指针运算符 === 
- 
-  * [[zh:​reference:​language:​pointer|* 取消引用运算符]] 
-  * [[zh:​reference:​language:​pointer|&​ 引用运算符]] 
- 
-=== 位运算符 === 
- 
-  * [[zh:​reference:​language:​bitwiseand|&​ (bitwise and)]] 
-  * [[zh:​reference:​language:​bitwiseand|| (bitwise or)]] 
-  * [[zh:​reference:​language:​bitwiseand|^ (bitwise xor)]] 
-  * [[zh:​reference:​language:​bitwisexornot|~ (bitwise not)]] 
-  * [[zh:​reference:​language:​bitshift|<<​ (bitshift left)]] 
-  * [[zh:​reference:​language:​bitshift|>>​ (bitshift right)]] 
- 
-=== 复合运算符 === 
- 
-  * [[zh:​reference:​language:​increment|++ (increment)]] 
-  * [[zh:​reference:​language:​increment|-- (decrement)]] 
-  * [[zh:​reference:​language:​incrementcompound|+= (compound addition)]] 
-  * [[zh:​reference:​language:​incrementcompound|-= (compound subtraction)]] 
-  * [[zh:​reference:​language:​incrementcompound|*= (compound multiplication)]] 
-  * [[zh:​reference:​language:​incrementcompound|/​= (compound division)]] 
-  * [[zh:​reference:​language:​bitwisecompoundand|&​= (compound bitwise and)]] 
-  * [[zh:​reference:​language:​bitwisecompoundor||= (compound bitwise or)]] 
- 
-===== 变量部分 ===== 
- 
-=== 常量 === 
- 
-  *[[zh:​reference:​language:​constants|HIGH]]|[[zh:​reference:​language:​constants|LOW]] 
-  *[[zh:​reference:​language:​constants|INPUT]]|[[zh:​reference:​language:​constants|OUTPUT]] 
-  *[[zh:​reference:​language:​constants|true]] | [[zh:​reference:​language:​constants|false]] 
-  *[[zh:​reference:​language:​integerconstants|integer constants]] 
-  *[[zh:​reference:​language:​fpconstants|floating point constants]] 
- 
-=== 数据类型 === 
- 
-  * [[zh:​reference:​language:​void|void]] 
-  * [[zh:​reference:​language:​booleanvariables|boolean]] 
-  * [[zh:​reference:​language:​char|char]] 
-  * [[zh:​reference:​language:​unsignedchar|unsigned char]] 
-  * [[zh:​reference:​language:​byte|byte]] 
-  * [[zh:​reference:​language:​int|int]] 
-  * [[zh:​reference:​language:​unsignedint|unsigned int]] 
-  * [[zh:​reference:​language:​word|word]] 
-  * [[zh:​reference:​language:​long|long]] 
-  * [[zh:​reference:​language:​unsignedlong|unsigned long]] 
-  * [[zh:​reference:​language:​float|float]] 
-  * [[zh:​reference:​language:​double|double]] 
-  * [[zh:​reference:​language:​string|string - char array]] 
-  * [[zh:​reference:​language:​stringobject|String - object]] 
-  * [[zh:​reference:​language:​arrays|array -(数组)]] 
- 
-=== 数据类型转换 === 
- 
-  * [[zh:​reference:​language:​charcast|char()]] 
-  * [[zh:​reference:​language:​bytecast|byte()]] 
-  * [[zh:​reference:​language:​intcast|int()]] 
-  * [[zh:​reference:​language:​wordcast|word()]] 
-  * [[zh:​reference:​language:​longcast|long()]] 
-  * [[zh:​reference:​language:​floatcast|float()]] 
- 
-=== 变量作用域 & 修饰符 === 
- 
-  * [[zh:​reference:​language:​scope|variable scope]] 
-  * [[zh:​reference:​language:​static|static]] 
-  * [[zh:​reference:​language:​volatile|volatile]] 
-  * [[zh:​reference:​language:​const|const]] 
- 
-=== 辅助工具 === 
- 
-  * [[zh:​reference:​language:​sizeof|sizeof()]] 
- 
-===== 函数部分 ===== 
- 
-=== 数字 I/O === 
- 
-  * [[zh:​reference:​language:​pinmode|pinMode()]] 
-  * [[zh:​reference:​language:​digitalwrite|digitalWrite()]] 
-  * [[zh:​reference:​language:​digitalread|digitalRead()]] 
- 
-=== 模拟 I/O === 
- 
-  * [[zh:​reference:​language:​analogreference|analogReference()]] 
-  * [[zh:​reference:​language:​analogread|analogRead()]] 
-  * [[zh:​reference:​language:​analogwrite|analogWrite() - PWM]] 
- 
-=== 高级 I/O === 
- 
-  * [[zh:​reference:​language:​tone|tone()]] 
-  * [[zh:​reference:​language:​notone|noTone()]] 
-  * [[zh:​reference:​language:​shiftout|shiftOut()]] 
-  * [[zh:​reference:​language:​shiftin|shiftIn()]] 
-  * [[zh:​reference:​language:​pulsein|pulseIn()]] 
- 
-=== 时间 === 
- 
-  * [[zh:​reference:​language:​millis|millis()]] 
-  * [[zh:​reference:​language:​micros|micros()]] 
-  * [[zh:​reference:​language:​delay|delay()]] 
-  * [[zh:​reference:​language:​delaymicroseconds|delayMicroseconds()]] 
- 
-=== 数学运算 === 
- 
-  * [[zh:​reference:​language:​min|min()]] 
-  * [[zh:​reference:​language:​max|max()]] 
-  * [[zh:​reference:​language:​abs|abs()]] 
-  * [[zh:​reference:​language:​constrain|constrain()]] 
-  * [[zh:​reference:​language:​map|map()]] 
-  * [[zh:​reference:​language:​pow|pow()]] 
-  * [[zh:​reference:​language:​sqrt|sqrt()]] 
-  * [[zh:​reference:​language:​ceil|ceil()]] 
-  * [[zh:​reference:​language:​exp|exp()]] 
-  * [[zh:​reference:​language:​fabs|fabs()]] 
-  * [[zh:​reference:​language:​floor|floor()]] 
-  * [[zh:​reference:​language:​fma|fma()]] 
-  * [[zh:​reference:​language:​fmax|fmax()]] 
-  * [[zh:​reference:​language:​fmin|fmin()]] 
-  * [[zh:​reference:​language:​fmod|fmod()]] 
-  * [[zh:​reference:​language:​ldexp|ldexp()]] 
-  * [[zh:​reference:​language:​log()|log()]] 
-  * [[zh:​reference:​language:​log10|log10()]] 
-  * [[zh:​reference:​language:​round|round()]] 
-  * [[zh:​reference:​language:​signbit|signbit()]] 
-  * [[zh:​reference:​language:​sq|sq()]] 
-  * [[zh:​reference:​language:​square|square()]] 
-  * [[zh:​reference:​language:​trunc|trunc()]] 
- 
-=== 三角函数 === 
- 
-  * [[zh:​reference:​language:​sin|sin()]] 
-  * [[zh:​reference:​language:​cos|cos()]] 
-  * [[zh:​reference:​language:​tan|tan()]] 
-  * [[zh:​reference:​language:​acos|acos()]] 
-  * [[zh:​reference:​language:​asin|asin()]] 
-  * [[zh:​reference:​language:​atan|atan()]] 
-  * [[zh:​reference:​language:​atan2|atan2()]] 
-  * [[zh:​reference:​language:​cosh|cosh()]] 
-  * [[zh:​reference:​language:​degrees|degrees()]] 
-  * [[zh:​reference:​language:​hypot|hypot()]] 
-  * [[zh:​reference:​language:​radians|radians()]] 
-  * [[zh:​reference:​language:​sinh|sinh()]] 
-  * [[zh:​reference:​language:​tanh|tanh()]] 
- 
-=== 随机数 === 
- 
-  * [[zh:​reference:​language:​randomseed|randomSeed()]] 
-  * [[zh:​reference:​language:​random|random()]] 
- 
-=== 位操作 === 
- 
-  * [[zh:​reference:​language:​lowbyte|lowByte()]] 
-  * [[zh:​reference:​language:​highbyte|highByte()]] 
-  * [[zh:​reference:​language:​bitread|bitRead()]] 
-  * [[zh:​reference:​language:​bitwrite|bitWrite()]] 
-  * [[zh:​reference:​language:​bitset|bitSet()]] 
-  * [[zh:​reference:​language:​bitclear|bitClear()]] 
-  * [[zh:​reference:​language:​bit|bit()]] 
- 
-=== 设置中断函数 === 
- 
-  * [[zh:​reference:​language:​attachinterrupt|attachInterrupt()]] 
-  * [[zh:​reference:​language:​detachinterrupt|detachInterrupt()]] 
- 
-=== 开关中断 === 
- 
-  * [[zh:​reference:​language:​interrupts|interrupts()]] 
-  * [[zh:​reference:​language:​nointerrupts|noInterrupts()]] 
- 
-=== 通讯 === 
- 
-  * [[zh:​reference:​language:​serial|Serial]] 
-  * [[zh:​reference:​language:​stream|Stream]] 
  
reference/language/main.txt · 最后更改: 2017/04/07 10:03 (外部编辑)