├── Language ├── Functions │ ├── Math │ │ ├── .gitkeep │ │ ├── sqrt.adoc │ │ ├── sq.adoc │ │ ├── abs.adoc │ │ ├── constrain.adoc │ │ └── pow.adoc │ ├── Time │ │ └── .gitkeep │ ├── Analog IO │ │ ├── .gitkeep │ │ └── analogReference.adoc │ ├── Digital IO │ │ └── .gitkeep │ ├── Interrupts │ │ ├── .gitkeep │ │ ├── noInterrupts.adoc │ │ └── interrupts.adoc │ ├── USB │ │ ├── Mouse │ │ │ ├── .gitkeep │ │ │ ├── mouseBegin.adoc │ │ │ └── mouseEnd.adoc │ │ ├── Keyboard │ │ │ ├── .gitkeep │ │ │ └── keyboardEnd.adoc │ │ └── Mouse.adoc │ ├── Advanced IO │ │ ├── .gitkeep │ │ ├── noTone.adoc │ │ ├── shiftIn.adoc │ │ ├── pulseIn.adoc │ │ └── tone.adoc │ ├── Bits and Bytes │ │ ├── .gitkeep │ │ ├── lowByte.adoc │ │ ├── highByte.adoc │ │ ├── bitSet.adoc │ │ ├── bitClear.adoc │ │ ├── bitRead.adoc │ │ ├── bitWrite.adoc │ │ └── bit.adoc │ ├── Communication │ │ ├── .gitkeep │ │ ├── Serial │ │ │ ├── .gitkeep │ │ │ ├── find.adoc │ │ │ ├── parseFloat.adoc │ │ │ ├── findUntil.adoc │ │ │ ├── readBytes.adoc │ │ │ ├── setTimeout.adoc │ │ │ ├── end.adoc │ │ │ ├── readBytesUntil.adoc │ │ │ ├── flush.adoc │ │ │ ├── peek.adoc │ │ │ ├── readString.adoc │ │ │ ├── parseInt.adoc │ │ │ ├── readStringUntil.adoc │ │ │ └── serialEvent.adoc │ │ ├── Stream │ │ │ ├── .gitkeep │ │ │ ├── streamFlush.adoc │ │ │ ├── streamAvailable.adoc │ │ │ ├── streamRead.adoc │ │ │ ├── streamReadString.adoc │ │ │ ├── streamSetTimeout.adoc │ │ │ ├── streamFind.adoc │ │ │ ├── streamFindUntil.adoc │ │ │ ├── streamPeek.adoc │ │ │ ├── streamReadStringUntil.adoc │ │ │ ├── streamParseFloat.adoc │ │ │ ├── streamReadBytes.adoc │ │ │ └── streamReadBytesUntil.adoc │ │ └── stream.adoc │ ├── Random Numbers │ │ └── .gitkeep │ ├── Trigonometry │ │ ├── .gitkeep │ │ ├── cos.adoc │ │ ├── sin.adoc │ │ └── tan.adoc │ ├── Arduino DUE only │ │ └── .gitkeep │ ├── External Interrupts │ │ ├── .gitkeep │ │ └── detachInterrupt.adoc │ └── Characters │ │ ├── isDigit.adoc │ │ ├── isSpace.adoc │ │ ├── isAscii.adoc │ │ ├── isAlpha.adoc │ │ ├── isUpperCase.adoc │ │ ├── isLowerCase.adoc │ │ ├── isControl.adoc │ │ ├── isPunct.adoc │ │ ├── isGraph.adoc │ │ ├── isAlphaNumeric.adoc │ │ ├── isPrintable.adoc │ │ ├── isHexadecimalDigit.adoc │ │ └── isWhitespace.adoc ├── Variables │ ├── Conversion │ │ ├── .gitkeep │ │ ├── intCast.adoc │ │ ├── byteCast.adoc │ │ ├── charCast.adoc │ │ ├── longCast.adoc │ │ ├── wordcast.adoc │ │ └── floatCast.adoc │ ├── Data Types │ │ ├── .gitkeep │ │ ├── boolean.adoc │ │ ├── String │ │ │ ├── Operators │ │ │ │ ├── append.adoc │ │ │ │ ├── elementAccess.adoc │ │ │ │ ├── differentFrom.adoc │ │ │ │ ├── comparison.adoc │ │ │ │ ├── concatenation.adoc │ │ │ │ ├── lessThan.adoc │ │ │ │ ├── greaterThan.adoc │ │ │ │ ├── lessThanOrEqualTo.adoc │ │ │ │ └── greaterThanOrEqualTo.adoc │ │ │ └── Functions │ │ │ │ ├── charAt.adoc │ │ │ │ ├── toUpperCase.adoc │ │ │ │ ├── lenght.adoc │ │ │ │ ├── toLowerCase.adoc │ │ │ │ ├── trim.adoc │ │ │ │ ├── startsWith.adoc │ │ │ │ ├── getBytes.adoc │ │ │ │ ├── equals.adoc │ │ │ │ ├── toCharArray.adoc │ │ │ │ ├── endsWith.adoc │ │ │ │ ├── concat.adoc │ │ │ │ ├── setCharAt.adoc │ │ │ │ ├── remove.adoc │ │ │ │ ├── equalsIgnoreCase.adoc │ │ │ │ ├── toInt.adoc │ │ │ │ ├── replace.adoc │ │ │ │ ├── c_str.adoc │ │ │ │ ├── indexOf.adoc │ │ │ │ ├── lastIndexOf.adoc │ │ │ │ ├── substring.adoc │ │ │ │ ├── compareTo.adoc │ │ │ │ ├── toFloat.adoc │ │ │ │ └── reserve.adoc │ │ ├── void.adoc │ │ ├── word.adoc │ │ ├── byte.adoc │ │ ├── double.adoc │ │ ├── unsignedChar.adoc │ │ ├── bool.adoc │ │ ├── short.adoc │ │ ├── long.adoc │ │ └── unsignedLong.adoc │ ├── Utilities │ │ └── .gitkeep │ ├── Variable Scope & Qualifiers │ │ ├── .gitkeep │ │ └── scope.adoc │ └── Constants │ │ └── floatingPointConstants.adoc └── Structure │ ├── Further Syntax │ ├── .gitkeep │ ├── semicolon.adoc │ └── include.adoc │ ├── Arithmetic Operators │ ├── .gitkeep │ └── modulo.adoc │ ├── Bitwise Operators │ ├── .gitkeep │ └── bitwiseOr.adoc │ ├── Boolean Operators │ ├── .gitkeep │ ├── logicalOr.adoc │ ├── logicalAnd.adoc │ └── logicalNot.adoc │ ├── Comparison Operators │ ├── .gitkeep │ ├── equalTo.adoc │ ├── notEqualTo.adoc │ ├── lessThan.adoc │ ├── greaterThan.adoc │ ├── lessThanOrEqualTo.adoc │ └── greaterThanOrEqualTo.adoc │ ├── Compound Operators │ ├── .gitkeep │ ├── decrement.adoc │ ├── increment.adoc │ ├── compoundAddition.adoc │ ├── compoundSubtraction.adoc │ ├── compoundDivision.adoc │ └── compoundMultiplication.adoc │ ├── Control Structure │ ├── .gitkeep │ ├── break.adoc │ ├── continue.adoc │ ├── doWhile.adoc │ ├── while.adoc │ ├── return.adoc │ └── goto.adoc │ ├── Pointer Access Operators │ ├── .gitkeep │ ├── reference.adoc │ └── dereference.adoc │ ├── .DS_Store │ └── Sketch │ ├── setup.adoc │ └── loop.adoc ├── AsciiDoc_sample ├── Reference_Terms │ └── attachments │ │ └── ArduinoUno_R3_Front_450px.jpg └── AsciiDoc_Dictionary │ └── attachments │ └── ArduinoUno_R3_Front_450px.jpg └── .drone.yml /Language/Functions/Math/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Time/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Analog IO/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Digital IO/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Interrupts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/USB/Mouse/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Variables/Conversion/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Variables/Utilities/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Advanced IO/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Communication/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Random Numbers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Trigonometry/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/USB/Keyboard/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Further Syntax/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Arduino DUE only/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Functions/External Interrupts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Arithmetic Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Bitwise Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Boolean Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/Pointer Access Operators/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Variables/Variable Scope & Qualifiers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Language/Structure/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/reference-jp/HEAD/Language/Structure/.DS_Store -------------------------------------------------------------------------------- /AsciiDoc_sample/Reference_Terms/attachments/ArduinoUno_R3_Front_450px.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/reference-jp/HEAD/AsciiDoc_sample/Reference_Terms/attachments/ArduinoUno_R3_Front_450px.jpg -------------------------------------------------------------------------------- /AsciiDoc_sample/AsciiDoc_Dictionary/attachments/ArduinoUno_R3_Front_450px.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/reference-jp/HEAD/AsciiDoc_sample/AsciiDoc_Dictionary/attachments/ArduinoUno_R3_Front_450px.jpg -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | trigger: 3 | image: plugins/downstream 4 | server: https://drone.arduino.cc 5 | secrets: [ downstream_token ] 6 | repositories: 7 | - bcmi-labs/reference 8 | when: 9 | branch: [master] -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/lowByte.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: lowByte() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = lowByte() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 変数の下位バイト(右側)を取り出します.(文字など) 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `lowByte(x)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: 全てのデータ型の値 32 | 33 | [float] 34 | === 戻り値 35 | byte 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // SEE ALSO SECTION 43 | [#see_also] 44 | -- 45 | 46 | [float] 47 | === 参照 48 | 49 | -- 50 | // SEE ALSO SECTION ENDS 51 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/highByte.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: highByte() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = highByte() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 変数の高位バイト(左側)を取り出します.大きなデータ型の場合は,2番目に低いバイトを取り出します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `highByte(x)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: 全てのデータ型の値 32 | 33 | [float] 34 | === 戻り値 35 | byte 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // SEE ALSO SECTION 44 | [#see_also] 45 | -- 46 | 47 | [float] 48 | === 参照 49 | 50 | -- 51 | // SEE ALSO SECTION ENDS 52 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/bitSet.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bitSet() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bitSet() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 数値変数のビットに1を書き込むことができます. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `bitSet(x, n)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: ビットをセットしたい数値変数の名前 32 | 33 | `n`: セットしたいビットの指定,一番右である最下位ビット(LSB)が0 34 | 35 | [float] 36 | === 戻り値 37 | なし 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | 45 | // SEE ALSO SECTION 46 | [#see_also] 47 | -- 48 | 49 | [float] 50 | === 参照 51 | 52 | -- 53 | // SEE ALSO SECTION ENDS 54 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/bitClear.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bitClear() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bitClear() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 数値変数のビットをクリア(0に書き換え)します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `bitClear(x, n)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: ビットをクリアしたい変数の名前 32 | 33 | `n`: クリアしたいビットの指定,一番右である最下位ビット(LSB)が0 34 | 35 | [float] 36 | === 戻り値 37 | なし 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | 45 | // SEE ALSO SECTION 46 | [#see_also] 47 | -- 48 | 49 | [float] 50 | === 参照 51 | 52 | -- 53 | // SEE ALSO SECTION ENDS 54 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/bitRead.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bitRead() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bitRead() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 指定したビットの数値を読み取ります. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `bitRead(x, n)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: 読み取りたい数値変数の名前 32 | 33 | `n`: 読み取りたいビットの指定,一番右である最下位ビット(LSB)が0 34 | 35 | 36 | [float] 37 | === 戻り値 38 | ビットの数値(0か1) 39 | 40 | -- 41 | // OVERVIEW SECTION ENDS 42 | 43 | 44 | 45 | 46 | // SEE ALSO SECTION 47 | [#see_also] 48 | -- 49 | 50 | [float] 51 | === 参照 52 | 53 | -- 54 | // SEE ALSO SECTION ENDS 55 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/bitWrite.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bitWrite() 3 | categories: [ "Functions" ] 4 | subCategories: [ "ビットとバイト" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bitWrite() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 数値変数にビットを書き込みます 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | `bitWrite(x, n, b)` 27 | 28 | 29 | [float] 30 | === パラメータ 31 | `x`: 書き込む対象となる数値変数 32 | 33 | `n`: どのビットに書き込むか,最下位ビット(LSB)側が0 34 | 35 | `b`: 書き込むビットの値(0または1) 36 | 37 | [float] 38 | === 戻り値 39 | なし 40 | 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | 45 | 46 | 47 | // SEE ALSO SECTION 48 | [#see_also] 49 | -- 50 | 51 | [float] 52 | === 参照 53 | 54 | -- 55 | // SEE ALSO SECTION ENDS 56 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/boolean.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: boolean 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = boolean 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | `boolean` is a non-standard type alias for link:../../../variables/data-types/bool/[bool] defined by Arduino. It's recommended to instead use the standard type `bool`, which is identical. 21 | 22 | 23 | [%hardbreaks] 24 | 25 | -- 26 | // OVERVIEW SECTION ENDS 27 | 28 | 29 | 30 | 31 | // SEE ALSO SECTION STARTS 32 | [#see_also] 33 | -- 34 | 35 | [float] 36 | === See also 37 | 38 | [role="language"] 39 | * #LANGUAGE# link:../../../variables/data-types/bool/[bool] 40 | 41 | -- 42 | // SEE ALSO SECTION ENDS 43 | -------------------------------------------------------------------------------- /Language/Functions/Advanced IO/noTone.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: noTone() 3 | title_expanded: "" 4 | categories: [ "Functions" ] 5 | subCategories: [ "応用入出力" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = noTone() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === 説明 21 | `tone()` によって生成された方形波の生成を停止します. 方形波が生成されていない場合はなにも行われません. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === 構文 27 | `noTone(pin)` 28 | 29 | 30 | [float] 31 | === パラメータ 32 | `pin`: 方形波の生成を停止したいピン 33 | 34 | [float] 35 | === 戻り値 36 | なし 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === 注意 48 | もし,違うピンを違う周波数に変更する場合は,noTone()を実行してから `tone()` を実行する前に必要があります. 49 | [%hardbreaks] 50 | 51 | -- 52 | // HOW TO USE SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/append.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "+=" 3 | title_expanded: append 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = += Append 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | It concatenates Strings with other data. 23 | 24 | [%hardbreaks] 25 | 26 | 27 | [float] 28 | === Syntax 29 | [source,arduino] 30 | ---- 31 | string += data 32 | ---- 33 | 34 | [float] 35 | === Parameters 36 | None 37 | 38 | [float] 39 | === Returns 40 | None 41 | 42 | -- 43 | 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Conversion/intCast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: int() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = int() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../../data-types/int[int] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `int(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | [float] 34 | === Returns 35 | `int` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../data-types/int[int] 54 | 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Functions/Advanced IO/shiftIn.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: shiftIn() 3 | categories: [ "Functions" ] 4 | subCategories: [ "応用入出力" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = shiftIn() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 1バイトのデータを1ビットだけシフトインします. 最上位ビット(MSB,左側)と最下位ビット(LSB,右側)のどちらからでも実行できます. それぞれのビットにおいて, 最初にクロックピンをHIGHにし, その次に,データラインから次のビットを読み取ります.その後,クロックピンはLOWに戻ります. 21 | 22 | もし,立ち上がりエッジをクロックとして使用するデバイスを接続する場合は,`shiftIn()` を実行する前に,最初にクロックピンをLOWにしておく必要があります.たとえば, `digitalWrite(clockPin, LOW)` を実行します. 23 | 24 | 注: この関数はソフトウェアによって実行されています; ハードウェアで実行され,高速で動作する link:https://www.arduino.cc/en/Reference/SPI[SPI library] も参照(特定のピンでしか動作しません). 25 | [%hardbreaks] 26 | 27 | 28 | [float] 29 | === 構文 30 | `byte incoming = shiftIn(dataPin, clockPin, bitOrder)` 31 | 32 | 33 | [float] 34 | === パラメータ 35 | `dataPin`: 各ビットを入力するピン (int) 36 | 37 | `clockPin`: *dataPin* からのデータ読み取りを指示するピン 38 | 39 | `bitOrder`: シフトする順番; *MSBFIRST* (最上位ビット側から) または *LSBFIRST*(最下位ビット側から) 40 | 41 | [float] 42 | === 戻り値 43 | 読み取った値 (byte) 44 | 45 | -- 46 | // OVERVIEW SECTION ENDS 47 | -------------------------------------------------------------------------------- /Language/Variables/Conversion/byteCast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: byte() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = byte() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../../data-types/byte[byte] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `byte(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | [float] 34 | === Returns 35 | `byte` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../data-types/byte[byte] 54 | 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Variables/Conversion/charCast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: char() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = char() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../../data-types/char[char] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `char(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | [float] 34 | === Returns 35 | `char` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../data-types/char[char] 54 | 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Variables/Conversion/longCast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: long() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = long() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../../data-types/long[long] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `long(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | [float] 34 | === Returns 35 | `long` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../data-types/long[long] 54 | 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Functions/Math/sqrt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: sqrt() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Math" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = sqrt(x) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | Calculates the square root of a number. 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `sqrt(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: the number, any data type 32 | 33 | [float] 34 | === Returns 35 | The number's square root. (double) 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../pow[pow()] + 54 | * #LANGUAGE# link:../sq[sq()] 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Structure/Sketch/setup.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: setup() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Sketch" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = setup() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | The `setup()` function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The `setup()` function will only run once, after each powerup or reset of the Arduino board. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | // HOW TO USE SECTION STARTS 28 | [#howtouse] 29 | -- 30 | 31 | [float] 32 | === Example Code 33 | 34 | [source,arduino] 35 | ---- 36 | int buttonPin = 3; 37 | 38 | void setup() 39 | { 40 | Serial.begin(9600); 41 | pinMode(buttonPin, INPUT); 42 | } 43 | 44 | void loop() 45 | { 46 | // ... 47 | } 48 | ---- 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | [role="language"] 54 | * #LANGUAGE# link:../loop[loop()] 55 | [%hardbreaks] 56 | 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/void.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: void 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = void 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | The `void` keyword is used only in function declarations. It indicates that the function is expected to return no information to the function from which it was called. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 36 | The code shows how to use `void`. 37 | 38 | [source,arduino] 39 | ---- 40 | // actions are performed in the functions "setup" and "loop" 41 | // but no information is reported to the larger program 42 | 43 | void setup() 44 | { 45 | // ... 46 | } 47 | 48 | void loop() 49 | { 50 | // ... 51 | } 52 | ---- 53 | [%hardbreaks] 54 | 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Functions/Math/sq.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: sq() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Math" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = sq(x) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the square of a number: the number multiplied by itself. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `sq(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: the number, any data type 32 | 33 | [float] 34 | === Returns 35 | The square of the number. (double) 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | 53 | [role="language"] 54 | * #LANGUAGE# link:../pow[pow()] + 55 | * #LANGUAGE# link:../sqrt[sqrt()] 56 | 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Functions/Math/abs.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: abs() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Math" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = abs(x) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the absolute of two numbers. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `abs(x)` 27 | 28 | [float] 29 | === Parameters 30 | `x`: the number 31 | 32 | [float] 33 | === Returns 34 | `x`: if x is greater than or equal to 0. 35 | 36 | `-x`: if x is less than 0. 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | 49 | [float] 50 | === Notes and Warnings 51 | Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results. 52 | [source,arduino] 53 | ---- 54 | abs(a++); // avoid this - yields incorrect results 55 | 56 | abs(a); // use this instead - 57 | a++; // keep other math outside the function 58 | ---- 59 | [%hardbreaks] 60 | 61 | 62 | -- 63 | // HOW TO USE SECTION ENDS 64 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/charAt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "charAt()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = charAt() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Access a particular character of the String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.charAt(n) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `n`: a variable of type String 38 | 39 | 40 | [float] 41 | === Returns 42 | The n'th character of the String. 43 | 44 | -- 45 | // OVERVIEW SECTION ENDS 46 | 47 | 48 | 49 | // HOW TO USE SECTION ENDS 50 | 51 | 52 | // SEE ALSO SECTION 53 | [#see_also] 54 | -- 55 | 56 | [float] 57 | === See also 58 | 59 | [role="example"] 60 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 61 | -- 62 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/toUpperCase.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "toUpperCase()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = toUpperCase() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Get an upper-case version of a String. As of 1.0, toUpperCase() modifies the string in place rather than returning a new one. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | string.toUpperCase() 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `string`: a variable of type String 35 | 36 | 37 | [float] 38 | === Returns 39 | None 40 | 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | 45 | 46 | // HOW TO USE SECTION ENDS 47 | 48 | 49 | // SEE ALSO SECTION 50 | [#see_also] 51 | -- 52 | 53 | [float] 54 | === See also 55 | 56 | [role="example"] 57 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 58 | -- 59 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/find.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.find() 3 | --- 4 | 5 | 6 | 7 | 8 | = Serial.find() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | Serial.find()は,シリアルバッファから指定された長さの文字列が与えられるまで,データを読み込みます.この関数は,文字列が見つかった時にtrueを返し,タイムアウトした時にはfalseを返します. 18 | Serial.find()は,link:../../stream[stream] utility classを継承しています. 19 | [%hardbreaks] 20 | 21 | 22 | [float] 23 | === 構文 24 | `Serial.find(target)` 25 | 26 | [float] 27 | === パラメータ 28 | `target` : 探したい文字列 (char) 29 | 30 | [float] 31 | === 戻り値 32 | `boolean` 33 | 34 | -- 35 | // OVERVIEW SECTION ENDS 36 | 37 | 38 | 39 | 40 | // HOW TO USE SECTION STARTS 41 | [#howtouse] 42 | -- 43 | 44 | [float] 45 | === 参照 46 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 47 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 48 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 49 | [role="language"] 50 | * #LANGUAGE# link:../../stream[stream] + 51 | * #LANGUAGE# link:../../stream/streamFind[stream.find()] 52 | 53 | -- 54 | // HOW TO USE SECTION ENDS 55 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/lenght.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "length()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = length() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Returns the length of the String, in characters. (Note that this doesn't include a trailing null character.) 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.length() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | The length of the String in characters. 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | // HOW TO USE SECTION ENDS 48 | 49 | 50 | // SEE ALSO SECTION 51 | [#see_also] 52 | -- 53 | 54 | [float] 55 | === See also 56 | 57 | [role="example"] 58 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 59 | -- 60 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/toLowerCase.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "toLowerCase()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = toLowerCase() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Get a lower-case version of a String. As of 1.0, toLowerCase() modifies the string in place rather than returning a new one. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.toLowerCase() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | None 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | // HOW TO USE SECTION ENDS 48 | 49 | 50 | // SEE ALSO SECTION 51 | [#see_also] 52 | -- 53 | 54 | [float] 55 | === See also 56 | 57 | [role="example"] 58 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 59 | -- 60 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/trim.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "trim()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = trim() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Get a version of the String with any leading and trailing whitespace removed. As of 1.0, trim() modifies the string in place rather than returning a new one. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.trim() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | None 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | // HOW TO USE SECTION ENDS 48 | 49 | 50 | // SEE ALSO SECTION 51 | [#see_also] 52 | -- 53 | 54 | [float] 55 | === See also 56 | 57 | [role="example"] 58 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 59 | -- 60 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/word.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: word 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = word 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | A word stores a 16-bit unsigned number, from 0 to 65535. Same as an unsigned int. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 36 | 37 | 38 | [source,arduino] 39 | ---- 40 | word w = 10000; 41 | ---- 42 | [%hardbreaks] 43 | 44 | [float] 45 | === See also 46 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 47 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 48 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 49 | [role="definition"] 50 | * #DEFINITION# link:../byte[byte] + 51 | * #DEFINITION# link:../word[word] 52 | 53 | -- 54 | // HOW TO USE SECTION ENDS 55 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isDigit.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isDigit()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isDigit(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが数字であるか解析します.thisCharが数字であれば,真を返します 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isDigit(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが数字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isDigit(this))     // thisが数字であるかテスト 54 | { 55 | Serial.println("The character is a number"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not a number"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Variables/Conversion/wordcast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: word() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = word() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../data-types/word[word] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `word(x)` + 27 | `word(h, l)` 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | `h`: the high-order (leftmost) byte of the word 34 | 35 | `l`: the low-order (rightmost) byte of the word 36 | [float] 37 | === Returns 38 | `word` 39 | 40 | -- 41 | // OVERVIEW SECTION ENDS 42 | 43 | 44 | 45 | 46 | // HOW TO USE SECTION STARTS 47 | [#howtouse] 48 | -- 49 | 50 | [float] 51 | === See also 52 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 53 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 54 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 55 | [role="language"] 56 | * #LANGUAGE# link:../../data-types/word[word] 57 | 58 | 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/startsWith.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "startsWith()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = startsWith() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Tests whether or not a String starts with the characters of another String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.startsWith(string2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string, string2`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | `true`: if string starts with the characters of string2 41 | 42 | `false`: otherwise 43 | -- 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Characters/isSpace.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isSpace()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isSpace(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが空白文字であるか解析します.thisCharが空白文字を含んでいる場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isAlpha(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが空白文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isSpace(this))     // thisが空白文字であるかテスト 54 | { 55 | Serial.println("The character is a space"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not a space"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isAscii.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isAscii()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isAscii(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charがAscii文字が解析します.thisCharにAscii文字が含まれていたら,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isAscii(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharがAscii文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isAscii(this))     // thisがAscii文字かテスト 54 | { 55 | Serial.println("The character is Ascii"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not Ascii"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/parseFloat.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.parseFloat() 3 | --- 4 | 5 | 6 | 7 | 8 | = Serial.parseFloat() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | `Serial.parseFloat()` は,シリアルバッファにある有効な最初のfloat型の値を返します.数字でない文字やマイナス符号はスキップされます.また,`parseFloat()` は,float型ではない文字の最初の文字の時点で終了されます. 18 | 19 | `Serial.parseFloat()` は,link:../../stream[Stream] utility classを継承しています. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === 構文 25 | `Serial.parseFloat()` 26 | 27 | 28 | [float] 29 | === パラメータ 30 | なし 31 | 32 | [float] 33 | === 戻り値 34 | `float` 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === 参照 48 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 49 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 50 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | [role="language"] 52 | * #LANGUAGE# link:../../stream[stream()] + 53 | * #LANGUAGE# link:../../stream/streamParseFloat[Stream.parseFloat()] 54 | 55 | -- 56 | // HOW TO USE SECTION ENDS 57 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/getBytes.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "getBytes()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = getBytes() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Copies the string's characters to the supplied buffer. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.getBytes(buf, len) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `buf`: the buffer to copy the characters into (_byte []_) 38 | 39 | `len`: the size of the buffer (_unsigned int_) 40 | 41 | [float] 42 | === Returns 43 | None 44 | 45 | -- 46 | // OVERVIEW SECTION ENDS 47 | 48 | 49 | 50 | // HOW TO USE SECTION ENDS 51 | 52 | 53 | // SEE ALSO SECTION 54 | [#see_also] 55 | -- 56 | 57 | [float] 58 | === See also 59 | 60 | [role="example"] 61 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 62 | -- 63 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Characters/isAlpha.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isAlpha()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isAlpha(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charのデータがアルファベット(文字)であるか解析します.thisCharに文字が含まれていたら,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isAlpha(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`:変数  *使用できるデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが文字ならば真 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isAlpha(this))     // thisが文字であるかテスト 54 | { 55 | Serial.println("The character is alphanumeric"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not alphanumeric"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | // SEE ALSO SECTION ENDS 76 | -- -------------------------------------------------------------------------------- /Language/Functions/Characters/isUpperCase.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isUpperCase()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isUpperCase(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが大文字であるか解析します.thisCharが大文字を含んでいる場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isUpperCase(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが大文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isAlpha(this))     // thisが大文字がテスト 54 | { 55 | Serial.println("The character is UPPER case"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not upper case"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Structure/Further Syntax/semicolon.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: ";" 3 | title_expanded: semicolon 4 | categories: [ "Structure" ] 5 | subCategories: [ "Further Syntax" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = ; Semicolon 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Used to end a statement. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | 30 | // HOW TO USE SECTION STARTS 31 | [#howtouse] 32 | -- 33 | 34 | [float] 35 | === Example Code 36 | 37 | [source,arduino] 38 | ---- 39 | int a = 13; 40 | ---- 41 | [%hardbreaks] 42 | 43 | [float] 44 | === Notes and Warnings 45 | Forgetting to end a line in a semicolon will result in a compiler error. The error text may be obvious, and refer to a missing semicolon, or it may not. If an impenetrable or seemingly illogical compiler error comes up, one of the first things to check is a missing semicolon, in the immediate vicinity, preceding the line at which the compiler complained. 46 | [%hardbreaks] 47 | 48 | [float] 49 | === See also 50 | [role="language"] 51 | * #LANGUAGE# link:../semicolon[; Semicolon] 52 | 53 | -- 54 | // HOW TO USE SECTION ENDS 55 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/equals.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "equals()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = equals() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares two strings for equality. The comparison is case-sensitive, meaning the String "hello" is not equal to the String "HELLO". 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.equals(string2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string, string2`: variables of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | `true`: if string equals string2 41 | 42 | `false`: otherwise 43 | -- 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/byte.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: byte 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = byte 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | A byte stores an 8-bit unsigned number, from 0 to 255. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 36 | 37 | 38 | [source,arduino] 39 | ---- 40 | 41 | ---- 42 | [%hardbreaks] 43 | 44 | [float] 45 | === Notes and Warnings 46 | [%hardbreaks] 47 | 48 | [float] 49 | === See also 50 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 51 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 52 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 53 | [role="definition"] 54 | * #DEFINITION# link:../word[word] + 55 | * #DEFINITION# link:../../conversion/byteCast[byte()] + 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isLowerCase.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isLowerCase()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isLowerCase(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが小文字であるか解析します.thisCharが小文字を含んでいる場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isLowerCase(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが小文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isLowerCase(this))     // thisが小文字がテスト 54 | { 55 | Serial.println("The character is lower case"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not lower case"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/toCharArray.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "toCharArray()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = toCharArray() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Copies the string's characters to the supplied buffer. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.toCharArray(buf, len) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `buf`: the buffer to copy the characters into (_char []_) 38 | 39 | `len`: the size of the buffer (_unsigned int_) 40 | 41 | [float] 42 | === Returns 43 | None 44 | 45 | -- 46 | // OVERVIEW SECTION ENDS 47 | 48 | 49 | 50 | // HOW TO USE SECTION ENDS 51 | 52 | 53 | // SEE ALSO SECTION 54 | [#see_also] 55 | -- 56 | 57 | [float] 58 | === See also 59 | 60 | [role="example"] 61 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 62 | -- 63 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Characters/isControl.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isControl()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isControl(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが制御文字か解析します.thisCharが制御文字の場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isControl(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが制御文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isControl(this))     // thisが制御文字かテスト 54 | { 55 | Serial.println("The character is a control character"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not a control character"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isPunct.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isPunct()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isPunct(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが区切り文字であるか解析します(コンマやセミコロン,感嘆符(!)など).thisCharが区切り文字の場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isPunct(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが区切り文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isPunct(this))     // thisが区切り文字がテスト 54 | { 55 | Serial.println("The character is a punctuation"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not a punctuation"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isGraph.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isGraph()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isGraph(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが表示可能なコンテンツであるか解析します.(スペースは表示可能だが,含みません)thisCharが表示可能ならば,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isGraph(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが表示可能な場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isGraph(this))     // thisが表示可能な文字かテスト(スペースを除く) 54 | { 55 | Serial.println("The character is printable"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not printable"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isAlphaNumeric.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isAlphaNumeric()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isAlphaNumeric(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが英数字であるか解析します.thisCharに数字か文字が含まれていたら,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isAlphaNumeric(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数 *使用可能なデータ型:* char 34 | 35 | [float] 36 | === Returns 37 | `true`: thisCharが英数字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isAlphaNumeric(this))     // thisが英数字かテスト 54 | { 55 | Serial.println("The character is alphanumeric"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not alphanumeric"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | // SEE ALSO SECTION ENDS 76 | -- -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/endsWith.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "endsWith()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = endsWith() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Tests whether or not a String ends with the characters of another String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.endsWith(string2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `string2`: another variable of type String 38 | 39 | 40 | [float] 41 | === Returns 42 | `true`: if string ends with the characters of string2 43 | 44 | `false`: otherwise 45 | 46 | -- 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Characters/isPrintable.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isPrintable()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isPrintable(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが表示可能であるか解析します(charは出力できる全ての文字であり,スペースも含みます).thisCharが表示可能な場合は真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isAlpha(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが表示可能な場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isPrintable(this))     // thisが表示可能かテスト 54 | { 55 | Serial.println("The character is printable"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not printable"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Bits and Bytes/bit.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bit() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Bits and Bytes" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bit() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Computes the value of the specified bit (bit 0 is 1, bit 1 is 2, bit 2 is 4, etc.). 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `bit(n)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `n`: the bit whose value to compute 32 | 33 | [float] 34 | === Returns 35 | The value of the bit. 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | 53 | [role="language"] 54 | * #LANGUAGE# link:../bitRead[bitRead()] + 55 | * #LANGUAGE# link:../bitWrite[bitWrite()] + 56 | * #LANGUAGE# link:../bitSet[bitSet()] + 57 | * #LANGUAGE# link:../bitClear[bitClear()] 58 | 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamFlush.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.flush() 3 | --- 4 | 5 | 6 | 7 | 8 | = flush() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `flush()` clears the buffer once all outgoing characters have been sent. 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.flush()` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `stream` : an instance of a class that inherits from Stream. 31 | 32 | [float] 33 | === Returns 34 | `boolean` 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === See also 48 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 49 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 50 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | [role="language"] 52 | * #LANGUAGE# link:../../stream[stream] 53 | 54 | -- 55 | // HOW TO USE SECTION ENDS 56 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/concat.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "concat()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = concat() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Appends the parameter to a String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.concat(parameter) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `parameter`: *Allowed types are* String, string, char, byte, int, unsigned int, long, unsigned long, float, double, __FlashStringHelper(F() macro). 36 | 37 | [float] 38 | === Returns 39 | `true`: success 40 | 41 | `false`: failure (in which case the string is left unchanged). 42 | 43 | -- 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/setCharAt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "setCharAt()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = setCharAt() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Sets a character of the String. Has no effect on indices outside the existing length of the String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.setCharAt(index, c) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `index`: the index to set the character at 38 | 39 | `c`: the character to store to the given location 40 | 41 | 42 | [float] 43 | === Returns 44 | None 45 | 46 | -- 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/remove.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "remove()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = remove() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Modify in place a string removing chars from the provided index to the end of the string or from the provided index to index plus count. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.remove(index) 31 | 32 | string.remove(index, count) 33 | ---- 34 | 35 | [float] 36 | === Parameters 37 | `index`: a variable of type unsigned int 38 | 39 | `count`: a variable of type unsigned int 40 | 41 | 42 | [float] 43 | === Returns 44 | None 45 | 46 | -- 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/elementAccess.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "[] " 3 | title_expanded: element access 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = [] Element Access 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Allows you access to the individual characters of a string. 23 | 24 | [%hardbreaks] 25 | 26 | 27 | [float] 28 | === Syntax 29 | [source,arduino] 30 | ---- 31 | char thisChar = string1[n] 32 | ---- 33 | 34 | [float] 35 | === Parameters 36 | `char thisChar` - a character variable 37 | 38 | `string1` - a string variable 39 | 40 | `int n` - a numeric variable 41 | 42 | [float] 43 | === Returns 44 | The nth char of the string. Same as charAt(). 45 | 46 | -- 47 | 48 | // OVERVIEW SECTION ENDS 49 | 50 | 51 | 52 | // HOW TO USE SECTION ENDS 53 | 54 | 55 | // SEE ALSO SECTION 56 | [#see_also] 57 | -- 58 | 59 | [float] 60 | === See also 61 | 62 | [role="example"] 63 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 64 | -- 65 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Conversion/floatCast.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: float() 3 | categories: [ "Variables" ] 4 | subCategories: [ "Conversion" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = float() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Converts a value to the link:../../data-types/float[float] data type. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `float(x)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: a value of any type 32 | 33 | [float] 34 | === Returns 35 | `float` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | [float] 47 | === Notes and Warnings 48 | See the reference for link:../../data-types/float[float] for details about the precision and limitations of floating point numbers on Arduino. 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 54 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 55 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 56 | 57 | * #LANGUAGE# link:../../data-types/float[float] 58 | 59 | 60 | -- 61 | // HOW TO USE SECTION ENDS 62 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/equalsIgnoreCase.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "equalsIgnoreCase()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = equalsIgnoreCase() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares two strings for equality. The comparison is not case-sensitive, meaning the String("hello") is equal to the String("HELLO"). 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.equalsIgnoreCase(string2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string, string2`: variables of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | `true`: if string equals string2 (ignoring case) 41 | 42 | `false`: otherwise 43 | -- 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Trigonometry/cos.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: cos() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Trigonometry" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = cos(rad) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the cosine of an angle (in radians). The result will be between -1 and 1. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `cos(rad)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `rad`: The angle in Radians (float). 32 | 33 | [float] 34 | === Returns 35 | The cos of the angle (`double`). 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../sin[sin()] + 54 | * #LANGUAGE# link:../tan[tan()] + 55 | * #LANGUAGE# link:../../../Variables/data-types/float[float] + 56 | * #LANGUAGE# link:../../../Variables/data-types/double[double] 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Functions/Trigonometry/sin.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: sin() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Trigonometry" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = sin(rad) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the sine of an angle (in radians). The result will be between -1 and 1. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `sin(rad)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `rad`: The angle in Radians (`float`). 32 | 33 | [float] 34 | === Returns 35 | The sine of the angle (`double`). 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../cos[cos()] + 54 | * #LANGUAGE# link:../tan[tan()] + 55 | * #LANGUAGE# link:../../../Variables/data-types/float[float] + 56 | * #LANGUAGE# link:../../../Variables/data-types/double[double] 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isHexadecimalDigit.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isHexadecimalDigit()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isHexadecimalDigit(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが16進数の値(A-F,0-9)であるか解析します.16進数の値を含んでいたら,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isHexadecimalDigit(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが16進数の値の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isHexadecimalDigit(this))     // thisが16進数の値であるかテスト 54 | { 55 | Serial.println("The character is an hexadecimal digit"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not an hexadecimal digit"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Characters/isWhitespace.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "isWhitespace()" 3 | categories: [ "Functions" ] 4 | subCategories: [ "文字" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = isWhitespace(thisChar) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | charが空白文字であるか解析します(スペースまたは改ページ('\f'),改行文字('\n'),リターン('\r'),タブ文字('\t'),垂直タブ('\v')).thisCharが空白文字の場合は,真を返します. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === 構文 26 | [source,arduino] 27 | ---- 28 | `isWhitespace(thisChar)` 29 | ---- 30 | 31 | [float] 32 | === パラメータ 33 | `thisChar`: 変数  *使用可能なデータ型:* char 34 | 35 | [float] 36 | === 戻り値 37 | `true`: thisCharが空白文字の場合 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === コード例 50 | 51 | [source,arduino] 52 | ---- 53 | if (isWhitespace(this))     // thisが空白文字かテスト 54 | { 55 | Serial.println("The character is a white space"); 56 | } 57 | else 58 | { 59 | Serial.println("The character is not a white space"); 60 | } 61 | 62 | ---- 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | 67 | 68 | // SEE ALSO SECTION 69 | [#see_also] 70 | -- 71 | 72 | [float] 73 | === 参照 74 | 75 | -- 76 | // SEE ALSO SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamAvailable.adoc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | = available() 6 | 7 | 8 | // OVERVIEW SECTION STARTS 9 | [#overview] 10 | -- 11 | 12 | [float] 13 | === Description 14 | `available()` gets the number of bytes available in the stream. This is only for bytes that have already arrived. 15 | 16 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 17 | [%hardbreaks] 18 | 19 | 20 | [float] 21 | === Syntax 22 | `stream.available()` 23 | 24 | 25 | [float] 26 | === Parameters 27 | `stream` : an instance of a class that inherits from Stream. 28 | 29 | [float] 30 | === Returns 31 | `int` : the number of bytes available to read 32 | 33 | -- 34 | // OVERVIEW SECTION ENDS 35 | 36 | 37 | 38 | 39 | // HOW TO USE SECTION STARTS 40 | [#howtouse] 41 | -- 42 | 43 | [float] 44 | === See also 45 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 46 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 47 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 48 | [role="language"] 49 | * #LANGUAGE# link:../../stream[stream] 50 | 51 | -- 52 | // HOW TO USE SECTION ENDS 53 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/break.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: break 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = break 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | [%hardbreaks] 21 | `break` is used to exit from a link:../for[for], link:../while[while] or link:../doWhile[do...while] loop, bypassing the normal loop condition. It is also used to exit from a link:../switchCase[switch case] statement. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | 30 | // HOW TO USE SECTION STARTS 31 | [#howtouse] 32 | -- 33 | [float] 34 | === Example Code 35 | In the following code, the control exits the `for` loop when the sensor value exceeds the threshold. 36 | [source,arduino] 37 | ---- 38 | for (x = 0; x < 255; x ++) 39 | { 40 | digitalWrite(PWMpin, x); 41 | sens = analogRead(sensorPin); 42 | if (sens > threshold){ // bail out on sensor detect 43 | x = 0; 44 | break; 45 | } 46 | delay(50); 47 | } 48 | ---- 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | [role="language"] 54 | * #LANGUAGE# link:../continue[continue] 55 | 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamRead.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.read() 3 | --- 4 | 5 | 6 | 7 | 8 | = read() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `read()` reads characters from an incoming stream to the buffer. 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.read()` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `stream` : an instance of a class that inherits from Stream. 31 | 32 | [float] 33 | === Returns 34 | The first byte of incoming data available (or -1 if no data is available). 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === See also 48 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 49 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 50 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | [role="language"] 52 | * #LANGUAGE# link:../../stream[stream] 53 | 54 | -- 55 | // HOW TO USE SECTION ENDS 56 | -------------------------------------------------------------------------------- /Language/Functions/Trigonometry/tan.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: tan() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Trigonometry" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = tan(rad) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the tangent of an angle (in radians). The result will be between negative infinity and infinity. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `tan(rad)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `rad`: The angle in Radians (`float`). 32 | 33 | [float] 34 | === Returns 35 | The tangent of the angle (`double`). 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../sin[sin()] + 54 | * #LANGUAGE# link:../cos[cos()] + 55 | * #LANGUAGE# link:../../../Variables/data-types/float[float] + 56 | * #LANGUAGE# link:../../../Variables/data-types/double[double] 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Functions/External Interrupts/detachInterrupt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: detachInterrupt() 3 | categories: [ "Functions" ] 4 | subCategories: [ "External Interrupts" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = detachInterrupt() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Turns off the given interrupt. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `detachInterrupt()` + 27 | `detachInterrupt(pin)` (Arduino Due only) 28 | 29 | [float] 30 | === Parameters 31 | `interrupt`: the number of the interrupt to disable (see link:../attachInterrupt[attachInterrupt()] for more details). 32 | 33 | `pin`: the pin number of the interrupt to disable (Arduino Due only) 34 | 35 | [float] 36 | === Returns 37 | Nothing 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | 45 | // HOW TO USE SECTION STARTS 46 | [#howtouse] 47 | -- 48 | 49 | [float] 50 | === See also 51 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 52 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 53 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 54 | [role="language"] 55 | * #LANGUAGE# link:../attachInterrupt[attachInterrupt()] 56 | 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/continue.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: continue 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = continue 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | [%hardbreaks] 21 | The `continue` statement skips the rest of the current iteration of a loop (link:../for[for], link:../while[while], or link:../doWhile[do...while]). It continues by checking the conditional expression of the loop, and proceeding with any subsequent iterations. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | 30 | // HOW TO USE SECTION STARTS 31 | [#howtouse] 32 | -- 33 | 34 | [float] 35 | === Example Code 36 | The following code writes the value of 0 to 255 to the `PWMpin`, but skips the values in the range of 41 to 119. 37 | [source,arduino] 38 | ---- 39 | for (x = 0; x <= 255; x ++) 40 | { 41 | if (x > 40 && x < 120){ // create jump in values 42 | continue; 43 | } 44 | 45 | digitalWrite(PWMpin, x); 46 | delay(50); 47 | } 48 | ---- 49 | [%hardbreaks] 50 | 51 | 52 | [float] 53 | === See also 54 | [role="language"] 55 | * #LANGUAGE# link:../break[break] 56 | 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/differentFrom.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "!=" 3 | title_expanded: different from 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = != Different From 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Compares two strings for difference. The comparison is case-sensitive, meaning the String "hello" is not equal to the String "HELLO". Functionally the same as string.equals() 23 | 24 | [%hardbreaks] 25 | 26 | 27 | [float] 28 | === Syntax 29 | [source,arduino] 30 | ---- 31 | string1 != string2 32 | ---- 33 | 34 | [float] 35 | === Parameters 36 | `string1, string2` - a string variable 37 | 38 | [float] 39 | === Returns 40 | `true`: if string1 is different from string2 41 | 42 | `false`: otherwise 43 | 44 | -- 45 | 46 | // OVERVIEW SECTION ENDS 47 | 48 | 49 | 50 | // HOW TO USE SECTION ENDS 51 | 52 | 53 | // SEE ALSO SECTION 54 | [#see_also] 55 | -- 56 | 57 | [float] 58 | === See also 59 | 60 | [role="example"] 61 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 62 | -- 63 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/findUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.findUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = Serial.findUntil() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | `Serial.findUntil()` は,シリアルバッファから指定された長さの文字列が与えられるか,終端文字が見つかるまで読み込みます. 18 | 19 | この関数は,文字列が見つかった時にtrueを返し,タイムアウトした時にはfalseを返します. 20 | 21 | `Serial.findUntil()` は,link:../../stream[stream] utility classを継承しています. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === 構文 27 | `Serial.findUntil(target, terminal)` 28 | 29 | 30 | [float] 31 | === パラメータ 32 | `target` : 探したい文字列 (char) 33 | `terminal` : 検索する終端文字 (char) 34 | 35 | [float] 36 | === 戻り値 37 | `boolean` 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | 45 | // HOW TO USE SECTION STARTS 46 | [#howtouse] 47 | -- 48 | 49 | [float] 50 | === 注意 51 | [%hardbreaks] 52 | 53 | [float] 54 | === 参照 55 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 56 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 57 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 58 | [role="language"] 59 | * #LANGUAGE# link:../../stream[stream] + 60 | * #LANGUAGE# link:../../stream/streamFindUntil[stream.findUntil()] 61 | 62 | -- 63 | // HOW TO USE SECTION ENDS 64 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/readBytes.adoc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | = Serial.readBytes() 6 | 7 | 8 | // OVERVIEW SECTION STARTS 9 | [#overview] 10 | -- 11 | 12 | [float] 13 | === 説明 14 | `Serial.readBytes()` はシリアルポートから文字を読み込み,バッファに格納します.指定長さの文字を読み取ったり,タイムアウトした場合に終了されます(link:../setTimeout[Serial.setTimeout()]を参照). 15 | 16 | `Serial.readBytes()` はバッファに格納された文字数を戻り値とします.0は有効なデータが見つからなかったことを意味します. 17 | 18 | `Serial.readBytes()` は link:../../stream[Stream] utility classを継承しています. 19 | [%hardbreaks] 20 | 21 | 22 | [float] 23 | === 構文 24 | `Serial.readBytes(buffer, length)` 25 | 26 | 27 | [float] 28 | === パラメータ 29 | `buffer`: 文字を格納するバッファ(`char[]` または `byte[]`) 30 | 31 | `length` : 読み込むバイト数 (`int`) 32 | 33 | [float] 34 | === 戻り値 35 | `byte` 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | 48 | [float] 49 | === 参照 50 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 51 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 52 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 53 | [role="language"] 54 | * #LANGUAGE# link:../../stream[stream] + 55 | * #LANGUAGE# link:../../stream/streamReadBytes[stream.readBytes()] 56 | 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/toInt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "toInt()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = toInt() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Converts a valid String to an integer. The input string should start with an integer number. If the string contains non-integer numbers, the function will stop performing the conversion. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.toInt() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | `long` 41 | 42 | If no valid conversion could be performed because the string doesn't start with a integer number, a zero is returned. 43 | 44 | -- 45 | // OVERVIEW SECTION ENDS 46 | 47 | 48 | 49 | // HOW TO USE SECTION ENDS 50 | 51 | 52 | // SEE ALSO SECTION 53 | [#see_also] 54 | -- 55 | 56 | [float] 57 | === See also 58 | 59 | [role="example"] 60 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 61 | -- 62 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Structure/Boolean Operators/logicalOr.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "||" 3 | title_expanded: logical or 4 | categories: [ "Structure" ] 5 | subCategories: [ "Boolean Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = || Logical OR 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | *Logical OR* results in a `true` if either of the two operands is `true`. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | This operator can be used inside the condition of an link:../../control-structures/if[if] statement. 36 | 37 | [source,arduino] 38 | ---- 39 | if (x > 0 || y > 0) { // if either x or y is greater than zero 40 | // statements 41 | } 42 | ---- 43 | 44 | [%hardbreaks] 45 | 46 | [float] 47 | === Notes and Warnings 48 | Do not confuse the boolean || (double pipe) operator with the bitwise OR operator | (single pipe). 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | 54 | [role="language"] 55 | * #LANGUAGE# link:../logicalAnd[&& Logical AND] 56 | * #LANGUAGE# link:../logicalNot[! Logical NOT] 57 | * #LANGUAGE# link:../../bitwise-operators/bitwiseNot[| Bitwise OR] 58 | 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/comparison.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "==" 3 | title_expanded: comparison 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = == Comparison 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Compares two strings for equality. The comparison is case-sensitive, meaning the String "hello" is not equal to the String "HELLO". Functionally the same as string.equals() 23 | 24 | 25 | [%hardbreaks] 26 | 27 | 28 | [float] 29 | === Syntax 30 | [source,arduino] 31 | ---- 32 | string1 == string2 33 | ---- 34 | 35 | [float] 36 | === Parameters 37 | `string1, string2` - a string variable 38 | 39 | [float] 40 | === Returns 41 | The nth char of the string. Same as charAt(). 42 | `true`: if string1 equals string2 43 | 44 | `false`: otherwise 45 | -- 46 | 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Structure/Control Structure/doWhile.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: do...while 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = do...while loop 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | [%hardbreaks] 21 | The `do...while` loop works in the same manner as the link:../while[while] loop, with the exception that the condition is tested at the end of the loop, so the do loop will always run at least once. 22 | 23 | [float] 24 | === Syntax 25 | [source,arduino] 26 | ---- 27 | do 28 | { 29 | // statement block 30 | } while (condition); 31 | ---- 32 | The `condition` is a boolean expression that evaluates to `true` or `false`. 33 | 34 | -- 35 | // OVERVIEW SECTION ENDS 36 | 37 | 38 | 39 | 40 | // HOW TO USE SECTION STARTS 41 | [#howtouse] 42 | -- 43 | 44 | [float] 45 | === Example Code 46 | 47 | [source,arduino] 48 | ---- 49 | do 50 | { 51 | delay(50); // wait for sensors to stabilize 52 | x = readSensors(); // check the sensors 53 | 54 | } while (x < 100); 55 | ---- 56 | [%hardbreaks] 57 | 58 | 59 | [float] 60 | === See also 61 | [role="language"] 62 | * #LANGUAGE# link:../for[for] 63 | * #LANGUAGE# link:../while[while] 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/concatenation.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "+" 3 | title_expanded: concatenation 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = + Concatenation 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Combines, or concatenates two strings into one new String. The second string is appended to the first, and the result is placed in a new String. Works the same as string.concat(). 23 | 24 | [%hardbreaks] 25 | 26 | 27 | [float] 28 | === Syntax 29 | [source,arduino] 30 | ---- 31 | string3 = string1 + string 2; string3 += string2; 32 | ---- 33 | 34 | [float] 35 | === Parameters 36 | `string, string1, string2, string3` - a string variable 37 | 38 | [float] 39 | === Returns 40 | new String that is the combination of the original two Strings. 41 | 42 | -- 43 | 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | // HOW TO USE SECTION ENDS 49 | 50 | 51 | // SEE ALSO SECTION 52 | [#see_also] 53 | -- 54 | 55 | [float] 56 | === See also 57 | 58 | [role="example"] 59 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 60 | -- 61 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/replace.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "replace()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = replace() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | The String replace() function allows you to replace all instances of a given character with another character. You can also use replace to replace substrings of a string with a different substring. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.replace(substring1, substring2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `substring1`: another variable of type String 38 | 39 | `substring2`: another variable of type String 40 | 41 | 42 | 43 | [float] 44 | === Returns 45 | None 46 | -- 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/double.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: double 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = double 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Double precision floating point number. On the Uno and other ATMEGA based boards, this occupies 4 bytes. That is, the double implementation is exactly the same as the float, with no gain in precision. 21 | 22 | On the Arduino Due, doubles have 8-byte (64 bit) precision. 23 | [%hardbreaks] 24 | 25 | -- 26 | // OVERVIEW SECTION ENDS 27 | 28 | 29 | 30 | 31 | // HOW TO USE SECTION STARTS 32 | [#howtouse] 33 | -- 34 | 35 | 36 | [float] 37 | === Notes and Warnings 38 | Users who borrow code from other sources that includes double variables may wish to examine the code to see if the implied precision is different from that actually achieved on ATMEGA based Arduinos. 39 | [%hardbreaks] 40 | 41 | [float] 42 | === See also 43 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 44 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 45 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 46 | [role="definition"] 47 | * #DEFINITION# link:../float[float] 48 | 49 | -- 50 | // HOW TO USE SECTION ENDS 51 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/setTimeout.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.setTimeout() 3 | --- 4 | 5 | 6 | 7 | 8 | = Serial.setTimeout() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `Serial.setTimeout()` sets the maximum milliseconds to wait for serial data when using link:../readBytesUntil[serial.readBytesUntil()] or link:../readBytes[serial.readBytes()]. It defaults to 1000 milliseconds. 18 | 19 | `Serial.setTimeout()` inherits from the link:../../stream[Stream] utility class. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `Serial.setTimeout(time)` 26 | 27 | [float] 28 | === Parameters 29 | `time` : timeout duration in milliseconds (`long`). 30 | 31 | [float] 32 | === Returns 33 | Nothing 34 | 35 | -- 36 | // OVERVIEW SECTION ENDS 37 | 38 | 39 | 40 | 41 | // HOW TO USE SECTION STARTS 42 | [#howtouse] 43 | -- 44 | 45 | [float] 46 | === See also 47 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 48 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 49 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 50 | [role="language"] 51 | * #LANGUAGE# link:../../stream[stream] + 52 | * #LANGUAGE# link:../../stream/streamSetTimeout[stream.setTimeout()] 53 | 54 | -- 55 | // HOW TO USE SECTION ENDS 56 | -------------------------------------------------------------------------------- /Language/Structure/Sketch/loop.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: loop() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Sketch" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = loop() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | After creating a link:../setup[setup()] function, which initializes and sets the initial values, the `loop()` function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | // HOW TO USE SECTION STARTS 28 | [#howtouse] 29 | -- 30 | 31 | [float] 32 | === Example Code 33 | [source,arduino] 34 | ---- 35 | int buttonPin = 3; 36 | 37 | // setup initializes serial and the button pin 38 | void setup() 39 | { 40 | beginSerial(9600); 41 | pinMode(buttonPin, INPUT); 42 | } 43 | 44 | // loop checks the button pin each time, 45 | // and will send serial if it is pressed 46 | void loop() 47 | { 48 | if (digitalRead(buttonPin) == HIGH) 49 | serialWrite('H'); 50 | else 51 | serialWrite('L'); 52 | 53 | delay(1000); 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === See also 60 | [role="language"] 61 | * #LANGUAGE# link:../setup[setup()] 62 | [%hardbreaks] 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/end.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.end() 3 | --- 4 | 5 | 6 | 7 | 8 | = end() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | シリアル通信を無効化し,RXとTXピンでの標準入出力を可能にします.シリアル通信を再開する場合には,link:../begin[Serial.begin()]を呼び出してください. 18 | [%hardbreaks] 19 | 20 | 21 | [float] 22 | === 構文 23 | `Serial.end()` 24 | 25 | _Arduino Megaのみ:_ 26 | 27 | `Serial1.end()` + 28 | `Serial2.end()` + 29 | `Serial3.end()` + 30 | 31 | 32 | [float] 33 | === パラメータ 34 | なし 35 | 36 | [float] 37 | === 戻り値 38 | なし 39 | 40 | -- 41 | // OVERVIEW SECTION ENDS 42 | 43 | 44 | -- 45 | 46 | 47 | [float] 48 | === 参照 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../begin[begin()] + 54 | * #LANGUAGE# link:../end[end()] + 55 | * #LANGUAGE# link:../available[available()] + 56 | * #LANGUAGE# link:../read[read()] + 57 | * #LANGUAGE# link:../peek[peek()] + 58 | * #LANGUAGE# link:../flush[flush()] + 59 | * #LANGUAGE# link:../print[print()] + 60 | * #LANGUAGE# link:../println[println()] + 61 | * #LANGUAGE# link:../write[write()] + 62 | * #LANGUAGE# link:../serialEvent[SerialEvent()] 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/decrement.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "--" 3 | title_expanded: decrement 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = -- Decrement 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Decrements the value of a variable by 1. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x-- ; // decrement x by one and returns the old value of x 30 | --x ; // decrement x by one and returns the new value of x 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `x`: variable. *Allowed data types:* integer, long (possibly unsigned) 36 | 37 | [float] 38 | === Returns 39 | The original or newly decremented value of the variable. 40 | 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | 45 | 46 | // HOW TO USE SECTION STARTS 47 | [#howtouse] 48 | -- 49 | 50 | [float] 51 | === Example Code 52 | 53 | [source,arduino] 54 | ---- 55 | x = 2; 56 | y = --x; // x now contains 1, y contains 1 57 | y = x--; // x contains 0, but y still contains 1 58 | ---- 59 | [%hardbreaks] 60 | 61 | [float] 62 | === See also 63 | 64 | [role="language"] 65 | * #LANGUAGE# link:../increment[Increment] 66 | * #LANGUAGE# link:../compoundSubtraction[Compound Subtraction] 67 | -- 68 | // HOW TO USE SECTION ENDS 69 | -------------------------------------------------------------------------------- /Language/Structure/Boolean Operators/logicalAnd.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "&&" 3 | title_expanded: logical and 4 | categories: [ "Structure" ] 5 | subCategories: [ "Boolean Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = && Logical AND 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | *Logical AND* results in `true` *only* if both operands are `true`. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | This operator can be used inside the condition of an link:../../control-structures/if[if] statement. 36 | 37 | [source,arduino] 38 | ---- 39 | if (digitalRead(2) == HIGH && digitalRead(3) == HIGH) { // if BOTH the switches read HIGH 40 | // statements 41 | } 42 | ---- 43 | [%hardbreaks] 44 | 45 | [float] 46 | === Notes and Warnings 47 | Make sure you don't mistake the boolean AND operator, && (double ampersand) for the bitwise AND operator & (single ampersand). They are entirely different beasts. 48 | [%hardbreaks] 49 | 50 | [float] 51 | === See also 52 | 53 | [role="language"] 54 | * #LANGUAGE# link:../logicalOr[|| Logical OR] 55 | * #LANGUAGE# link:../logicalNot[! Logical NOT] 56 | * #LANGUAGE# link:../../bitwise-operators/bitwiseAnd[& (Bitwise AND)] 57 | 58 | -- 59 | // HOW TO USE SECTION ENDS 60 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/c_str.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "c_str()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = c_str() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Converts the contents of a string as a C-style, null-terminated string. Note that this gives direct access to the internal String buffer and should be used with care. In particular, you should never modify the string through the pointer returned. When you modify the String object, or when it is destroyed, any pointer previously returned by c_str() becomes invalid and should not be used any longer. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.c_str() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | none 36 | 37 | [float] 38 | === Returns 39 | A pointer to the C-style version of the invoking string. 40 | 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | 45 | 46 | // HOW TO USE SECTION ENDS 47 | 48 | 49 | // SEE ALSO SECTION 50 | [#see_also] 51 | -- 52 | 53 | [float] 54 | === See also 55 | 56 | [role="example"] 57 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 58 | -- 59 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/indexOf.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "indexOf()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = indexOf() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Locates a character or String within another String. By default, searches from the beginning of the String, but can also start from a given index, allowing for the locating of all instances of the character or String. 22 | 23 | 24 | [%hardbreaks] 25 | 26 | 27 | [float] 28 | === Syntax 29 | [source,arduino] 30 | ---- 31 | string.indexOf(val) 32 | 33 | string.indexOf(val, from) 34 | ---- 35 | 36 | [float] 37 | === Parameters 38 | `string`: a variable of type String 39 | 40 | `val`: the value to search for - char or String 41 | 42 | `from`: the index to start the search from 43 | 44 | [float] 45 | === Returns 46 | The index of val within the String, or -1 if not found. 47 | 48 | -- 49 | // OVERVIEW SECTION ENDS 50 | 51 | 52 | 53 | // HOW TO USE SECTION ENDS 54 | 55 | 56 | // SEE ALSO SECTION 57 | [#see_also] 58 | -- 59 | 60 | [float] 61 | === See also 62 | 63 | [role="example"] 64 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 65 | -- 66 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamReadString.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.readString() 3 | --- 4 | 5 | 6 | 7 | 8 | = readString() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `readString()` reads characters from a stream into a string. The function terminates if it times out (see link:../streamSetTimeout[setTimeout()]). 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.readString()` 26 | 27 | 28 | [float] 29 | === Parameters 30 | Nothing 31 | 32 | [float] 33 | === Returns 34 | A string read from a stream. 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 49 | 50 | [float] 51 | === See also 52 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 53 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 54 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 55 | [role="language"] 56 | * #LANGUAGE# link:../../stream[stream] 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/while.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: while 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = while loop 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | [%hardbreaks] 21 | A `while` loop will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit. This could be in your code, such as an incremented variable, or an external condition, such as testing a sensor. 22 | 23 | [float] 24 | === Syntax 25 | [source,arduino] 26 | ---- 27 | while(condition){ 28 | // statement(s) 29 | } 30 | ---- 31 | The `condition` is a boolean expression that evaluates to `true` or `false`. 32 | 33 | -- 34 | // OVERVIEW SECTION ENDS 35 | 36 | 37 | 38 | 39 | // HOW TO USE SECTION STARTS 40 | [#howtouse] 41 | -- 42 | 43 | [float] 44 | === Example Code 45 | 46 | [source,arduino] 47 | ---- 48 | var = 0; 49 | while(var < 200){ 50 | // do something repetitive 200 times 51 | var++; 52 | } 53 | ---- 54 | [%hardbreaks] 55 | 56 | 57 | [float] 58 | === See also 59 | 60 | [role="language"] 61 | * #LANGUAGE# link:../doWhile[do...while] 62 | 63 | [role="example"] 64 | * #EXAMPLE# http://arduino.cc/en/Tutorial/WhileLoop[While Loop Tutorial^] 65 | 66 | -- 67 | // HOW TO USE SECTION ENDS 68 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/lastIndexOf.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "lastIndexOf()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = lastIndexOf() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Locates a character or String within another String. By default, searches from the end of the String, but can also work backwards from a given index, allowing for the locating of all instances of the character or String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.lastIndexOf(val) 31 | 32 | string.lastIndexOf(val, from) 33 | ---- 34 | 35 | [float] 36 | === Parameters 37 | `string`: a variable of type String 38 | 39 | `val`: the value to search for - char or String 40 | 41 | `from`: the index to work backwards from 42 | 43 | 44 | [float] 45 | === Returns 46 | The index of val within the String, or -1 if not found. 47 | 48 | -- 49 | // OVERVIEW SECTION ENDS 50 | 51 | 52 | 53 | // HOW TO USE SECTION ENDS 54 | 55 | 56 | // SEE ALSO SECTION 57 | [#see_also] 58 | -- 59 | 60 | [float] 61 | === See also 62 | 63 | [role="example"] 64 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 65 | -- 66 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/readBytesUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.readBytesUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = Serial.readBytesUntil() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | Serial.readBytesUntil() シリアルバッファから読み取った文字列を配列に格納します.終端文字を読み込んだ時や,指定の長さの文字列が読み込まれた時,タイムアウトした時に,この関数は終了されます.(link:../setTimeout[Serial.setTimeout()]を参照) 18 | 19 | `Serial.readBytesUntil()` はバッファに読み込まれた文字数を返します.0は有効なデータがなかったことを意味します. 20 | 21 | `Serial.readBytesUntil()` はlink:../../stream[Stream] utility classを継承しています. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === 構文 27 | `Serial.readBytesUntil(character, buffer, length)` 28 | 29 | 30 | [float] 31 | === パラメータ 32 | `character` : 探したい文字(`char`) 33 | 34 | `buffer`: 文字列を格納するバッファ(`char[]` or `byte[]`) 35 | 36 | `length` : 読み込むバイト数 (`int`) 37 | 38 | [float] 39 | === 戻り値 40 | `byte` 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | 48 | // HOW TO USE SECTION STARTS 49 | [#howtouse] 50 | -- 51 | 52 | [float] 53 | === 参照 54 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 55 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 56 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | [role="language"] 58 | * #LANGUAGE# link:../../stream[Stream] + 59 | * #LANGUAGE# link:../../stream/streamReadBytesUntil[Stream.readByteUntil()] 60 | -- 61 | // HOW TO USE SECTION ENDS 62 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/increment.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "++" 3 | title_expanded: increment 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = ++ Increment 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Increments the value of a variable by 1. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x++; // increment x by one and returns the old value of x 30 | ++x; // increment x by one and returns the new value of x 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `x`: variable. *Allowed data types:* integer, long (possibly unsigned) 36 | 37 | [float] 38 | === Returns 39 | The original or newly incremented value of the variable. 40 | 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | 45 | 46 | // HOW TO USE SECTION STARTS 47 | [#howtouse] 48 | -- 49 | 50 | [float] 51 | === Example Code 52 | 53 | [source,arduino] 54 | ---- 55 | x = 2; 56 | y = ++x; // x now contains 3, y contains 3 57 | y = x++; // x contains 4, but y still contains 3 58 | ---- 59 | [%hardbreaks] 60 | 61 | [float] 62 | === Notes and Warnings 63 | [%hardbreaks] 64 | 65 | [float] 66 | === See also 67 | 68 | [role="language"] 69 | * #LANGUAGE# link:../decrement[Decrement] 70 | * #LANGUAGE# link:../compoundAddition[Compound Addition] 71 | 72 | -- 73 | // HOW TO USE SECTION ENDS 74 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamSetTimeout.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.setTimeout() 3 | --- 4 | 5 | 6 | 7 | 8 | = setTimeout() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `setTimeout()` sets the maximum milliseconds to wait for stream data, it defaults to 1000 milliseconds. This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the #LANGUAGE# link:../../stream[Stream class] main page for more information. 18 | [%hardbreaks] 19 | 20 | 21 | [float] 22 | === Syntax 23 | `stream.setTimeout(time)` 24 | 25 | 26 | [float] 27 | === Parameters 28 | `stream` : an instance of a class that inherits from Stream. 29 | `time` : timeout duration in milliseconds (`long`). 30 | 31 | [float] 32 | === Returns 33 | Nothing 34 | 35 | -- 36 | // OVERVIEW SECTION ENDS 37 | 38 | 39 | 40 | 41 | // HOW TO USE SECTION STARTS 42 | [#howtouse] 43 | -- 44 | 45 | [float] 46 | === Example Code 47 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 48 | 49 | [float] 50 | === See also 51 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 52 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 53 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 54 | [role="language"] 55 | * #LANGUAGE# link:../../stream[stream] 56 | -- 57 | // HOW TO USE SECTION ENDS 58 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/substring.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "substring()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = substring() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Get a substring of a String. The starting index is inclusive (the corresponding character is included in the substring), but the optional ending index is exclusive (the corresponding character is not included in the substring). If the ending index is omitted, the substring continues to the end of the String. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.substring(from) 31 | 32 | string.substring(from, to) 33 | ---- 34 | 35 | [float] 36 | === Parameters 37 | `string`: a variable of type String 38 | 39 | `from`: the index to start the substring at 40 | 41 | `to` (optional): the index to end the substring before 42 | 43 | 44 | [float] 45 | === Returns 46 | The substring. 47 | 48 | -- 49 | // OVERVIEW SECTION ENDS 50 | 51 | 52 | 53 | // HOW TO USE SECTION ENDS 54 | 55 | 56 | // SEE ALSO SECTION 57 | [#see_also] 58 | -- 59 | 60 | [float] 61 | === See also 62 | 63 | [role="example"] 64 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 65 | -- 66 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/compareTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "compareTo()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = compareTo() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares two Strings, testing whether one comes before or after the other, or whether they're equal. The strings are compared character by character, using the ASCII values of the characters. That means, for example, that 'a' comes before 'b' but after 'A'. Numbers come before letters. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.compareTo(string2) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | `string2`: another variable of type String 38 | 39 | 40 | [float] 41 | === Returns 42 | `a negative number`: if string comes before string2 43 | 44 | `0`: if string equals string2 45 | 46 | `a positive number`: if string comes after string2 47 | -- 48 | 49 | // OVERVIEW SECTION ENDS 50 | 51 | 52 | 53 | // HOW TO USE SECTION ENDS 54 | 55 | 56 | // SEE ALSO SECTION 57 | [#see_also] 58 | -- 59 | 60 | [float] 61 | === See also 62 | 63 | [role="example"] 64 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 65 | -- 66 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/equalTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "==" 3 | title_expanded: equal to 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = == Equal To 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the two operands are equal. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x == y; // is true if x is equal to y and it is false if x is not equal to y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x==y) // tests if x is equal to y 52 | { 53 | // do something only if the comparison result is true 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === Notes and Warnings 60 | [%hardbreaks] 61 | 62 | [float] 63 | === See also 64 | 65 | [role="language"] 66 | * #LANGUAGE# link:../notequalto[Comparison Not Equal To] 67 | * #LANGUAGE# link:../greaterthan[Comparison Greater Than] 68 | * #LANGUAGE# link:../lessthan[Comparison Less Than] 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamFind.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.find() 3 | --- 4 | 5 | 6 | 7 | 8 | = find() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `find()` reads data from the stream until the target string of given length is found The function returns true if target string is found, false if timed out. 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.find(target)` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `stream` : an instance of a class that inherits from Stream. 31 | 32 | `target` : the string to search for (char) 33 | 34 | [float] 35 | === Returns 36 | `boolean` 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | 52 | [float] 53 | === See also 54 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 55 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 56 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | [role="language"] 58 | * #LANGUAGE# link:../../stream[stream] 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamFindUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.findUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = `findUntil()` 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `findUntil()` reads data from the stream until the target string of given length or terminator string is found. 18 | 19 | The function returns true if target string is found, false if timed out 20 | 21 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the #LANGUAGE# link:../../stream[Stream class] main page for more information. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | `stream.findUntil(target, terminal)` 28 | 29 | 30 | [float] 31 | === Parameters 32 | `stream.findUntil(target, terminal)` 33 | 34 | [float] 35 | === Returns 36 | `boolean` 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | 52 | [float] 53 | === See also 54 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 55 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 56 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | [role="language"] 58 | * #LANGUAGE# link:../../stream[stream] 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/notEqualTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "!=" 3 | title_expanded: not equal to 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = != Not Equal To 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the two operands are not equal. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x != y; // is false if x is equal to y and it is true if x is not equal to y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x!=y) // tests if x is not equal to y 52 | { 53 | // do something only if the comparison result is true 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === Notes and Warnings 60 | [%hardbreaks] 61 | 62 | [float] 63 | === See also 64 | 65 | [role="language"] 66 | * #LANGUAGE# link:../equalto[Comparison Equal To] 67 | * #LANGUAGE# link:../greaterthan[Comparison Greater Than] 68 | * #LANGUAGE# link:../lessthan[Comparison Less Than] 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/unsignedChar.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: unsigned char 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = unsigned char 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | An unsigned data type that occupies 1 byte of memory. Same as the link:../byte[byte] datatype. 21 | 22 | The unsigned char datatype encodes numbers from 0 to 255. 23 | 24 | For consistency of Arduino programming style, the byte data type is to be preferred. 25 | [%hardbreaks] 26 | 27 | -- 28 | // OVERVIEW SECTION ENDS 29 | 30 | 31 | 32 | 33 | // HOW TO USE SECTION STARTS 34 | [#howtouse] 35 | -- 36 | 37 | [float] 38 | === Example Code 39 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 40 | 41 | 42 | [source,arduino] 43 | ---- 44 | unsigned char myChar = 240; 45 | ---- 46 | [%hardbreaks] 47 | 48 | 49 | [float] 50 | === See also 51 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 52 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 53 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 54 | [role="definition"] 55 | * #DEFINITION# link:../byte[byte] + 56 | * #DEFINITION# link:../int[int] + 57 | * #DEFINITION# link:../array[array] 58 | 59 | [role="language"] 60 | * #LANGUAGE# link:../../../functions/communication/serial/println[Serial.println] 61 | 62 | -- 63 | // HOW TO USE SECTION ENDS 64 | -------------------------------------------------------------------------------- /Language/Structure/Boolean Operators/logicalNot.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "!" 3 | title_expanded: logical not 4 | categories: [ "Structure" ] 5 | subCategories: [ "Boolean Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = ! Logical NOT 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | *Logical NOT* results in a `true` if the operand is `false` and vice versa. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | This operator can be used inside the condition of an link:../../control-structures/if[if] statement. 36 | 37 | [source,arduino] 38 | ---- 39 | if (!x) { // if x is not true 40 | // statements 41 | } 42 | ---- 43 | 44 | It can be used to invert the boolean value. 45 | [source,arduino] 46 | ---- 47 | x = !y; // the inverted value of y is stored in x 48 | ---- 49 | 50 | 51 | [%hardbreaks] 52 | 53 | [float] 54 | === Notes and Warnings 55 | The bitwise not ~ (tilde) looks much different than the boolean not ! (exclamation point or "bang" as the programmers say) but you still have to be sure which one you want where. 56 | [%hardbreaks] 57 | 58 | [float] 59 | === See also 60 | 61 | [role="language"] 62 | * #LANGUAGE# link:../logicalAnd[&& Logical AND] 63 | * #LANGUAGE# link:../logicalOr[|| Logical OR] 64 | * #LANGUAGE# link:../../bitwise-operators/bitwiseNot[~ Bitwise NOT] 65 | 66 | -- 67 | // HOW TO USE SECTION ENDS 68 | -------------------------------------------------------------------------------- /Language/Variables/Constants/floatingPointConstants.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Floating Point Constants 3 | categories: [ "Variables" ] 4 | subCategories: [ "Constants" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = Floating Point Constants 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Similar to integer constants, floating point constants are used to make code more readable. Floating point constants are swapped at compile time for the value to which the expression evaluates. 21 | [%hardbreaks] 22 | 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | 28 | // HOW TO USE SECTION STARTS 29 | [#howtouse] 30 | -- 31 | 32 | [float] 33 | === Example Code 34 | 35 | [source,arduino] 36 | ---- 37 | n = 0.005; // 0.005 is a floating point constant 38 | ---- 39 | [%hardbreaks] 40 | 41 | [float] 42 | === Notes and Warnings 43 | Floating point constants can also be expressed in a variety of scientific notation. 'E' and 'e' are both accepted as valid exponent indicators. 44 | [%hardbreaks] 45 | 46 | |=== 47 | |floating-point constant |evaluates to: |also evaluates to: 48 | 49 | |10.0 50 | |10 51 | | 52 | 53 | |2.34E5 54 | |2.34 * 10^5 55 | |234000 56 | 57 | |67e-12 58 | |67.0 * 10^-12 59 | |0.000000000067 60 | 61 | |=== 62 | [%hardbreaks] 63 | 64 | 65 | 66 | [float] 67 | === See also 68 | 69 | [role="language"] 70 | * #LANGUAGE# link:../constants[Constants] 71 | * #LANGUAGE# link:../integerConstants[Integer Constants] 72 | 73 | -- 74 | // HOW TO USE SECTION ENDS 75 | -------------------------------------------------------------------------------- /Language/Functions/Advanced IO/pulseIn.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: pulseIn() 3 | categories: [ "Functions" ] 4 | subCategories: [ "応用入出力" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = pulseIn() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | ピンに入力されたのパルス信号を読み取ります(HIGH または LOW). たとえば,`pulseIn()` を *HIGH* に設定した場合, ピンが *HIGH* になった時点を開始時間とし, *LOW* になった時点を終了時間とします.そして,そのパルス幅をマイクロ秒で返します.タイムアウト時間を設定し,タイムアウトした場合は,0を返します. 21 | 22 | 経験上,この関数で長いパルスを計測するとエラーが発生する場合があります.10マイクロ秒から3分のパルス幅の間で作動します. 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === 構文 28 | `pulseIn(pin, value)` 29 | 30 | `pulseIn(pin, value, timeout)` 31 | 32 | [float] 33 | === パラメータ 34 | `pin`: パルスを読み取りたいピンの番号 (int) 35 | 36 | `value`: 読み取りたいパルスの種類: link:../../../variables/constants/constants/[HIGH] または link:../../../variables/constants/constants/[LOW]. (int) 37 | 38 | `timeout` (任意): パルスを何マイクロ秒待つか; 初期値は1秒 (unsigned long) 39 | 40 | [float] 41 | === 戻り値 42 | パルス幅(マイクロ秒).もし,タイムアウトまでパルスが入力されなかった場合は0 (unsigned long) 43 | 44 | -- 45 | // OVERVIEW SECTION ENDS 46 | 47 | 48 | 49 | 50 | // HOW TO USE SECTION STARTS 51 | [#howtouse] 52 | -- 53 | 54 | [float] 55 | === コード例 56 | // Describe what the example code is all about and add relevant code   ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | この例では,7番ピンのパルス幅を測定します. 58 | 59 | [source,arduino] 60 | ---- 61 | int pin = 7; 62 | unsigned long duration; 63 | 64 | void setup() 65 | { 66 | pinMode(pin, INPUT); 67 | } 68 | 69 | void loop() 70 | { 71 | duration = pulseIn(pin, HIGH); 72 | } 73 | ---- 74 | [%hardbreaks] 75 | 76 | -- 77 | // HOW TO USE SECTION ENDS 78 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/toFloat.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "toFloat()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = toFloat() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Converts a valid String to a float. The input string should start with a digit. If the string contains non-digit characters, the function will stop performing the conversion. For example, the strings "123.45", "123", and "123fish" are converted to 123.45, 123.00, and 123.00 respectively. Note that "123.456" is approximated with 123.46. Note too that floats have only 6-7 decimal digits of precision and that longer strings might be truncated. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.toFloat() 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `string`: a variable of type String 36 | 37 | 38 | [float] 39 | === Returns 40 | `float` 41 | 42 | If no valid conversion could be performed because the string doesn't start with a digit, a zero is returned. 43 | 44 | -- 45 | // OVERVIEW SECTION ENDS 46 | 47 | 48 | 49 | // HOW TO USE SECTION ENDS 50 | 51 | 52 | // SEE ALSO SECTION 53 | [#see_also] 54 | -- 55 | 56 | [float] 57 | === See also 58 | 59 | [role="example"] 60 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 61 | -- 62 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/compoundAddition.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "+=" 3 | title_expanded: compound addition 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = += Compound Addition 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | This is a convenient shorthand to perform addition on a variable with another constant or variable. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x += y; // equivalent to the expression x = x + y; 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | x = 2; 52 | x += 4; // x now contains 6 53 | ---- 54 | [%hardbreaks] 55 | 56 | [float] 57 | === Notes and Warnings 58 | [%hardbreaks] 59 | 60 | [float] 61 | === See also 62 | 63 | [role="language"] 64 | * #LANGUAGE# link:../../arithmetic-operators/addition[Normal Addition] 65 | * #LANGUAGE# link:../compoundSubtraction[Compound Subtraction] 66 | * #LANGUAGE# link:../compoundMultiplication[Compound Multiplication] 67 | * #LANGUAGE# link:../compoundDivision[Compound Division] 68 | 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/flush.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.flush() 3 | --- 4 | 5 | 6 | 7 | 8 | = flush() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | シリアルデータの送信が完了するまで通信を待ちます.(Arduino 1.0より前では,バッファに受信された全てのデータを削除していました.) 18 | 19 | `flush()` は,link:../flush[Stream] utility classを継承しています. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === 構文 25 | `Serial.flush()` 26 | 27 | _Arduino Megaのみ:_ 28 | 29 | `Serial1.flush()` + 30 | `Serial2.flush()` + 31 | `Serial3.flush()` 32 | 33 | 34 | [float] 35 | === パラメータ 36 | なし 37 | 38 | [float] 39 | === 戻り値 40 | なし 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | 48 | // HOW TO USE SECTION STARTS 49 | [#howtouse] 50 | -- 51 | 52 | [float] 53 | === 参照 54 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 55 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 56 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | [role="language"] 58 | * #LANGUAGE# link:../begin[begin()] + 59 | * #LANGUAGE# link:../end[end()] + 60 | * #LANGUAGE# link:../available[available()] + 61 | * #LANGUAGE# link:../read[read()] + 62 | * #LANGUAGE# link:../peek[peek()] + 63 | * #LANGUAGE# link:../flush[flush()] + 64 | * #LANGUAGE# link:../print[print()] + 65 | * #LANGUAGE# link:../println[println()] + 66 | * #LANGUAGE# link:../write[write()] + 67 | * #LANGUAGE# link:../serialEvent[SerialEvent()] + 68 | * #LANGUAGE# link:../../stream/streamFlush[stream.flush()] 69 | 70 | -- 71 | // HOW TO USE SECTION ENDSp 72 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamPeek.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.peek() 3 | --- 4 | 5 | 6 | 7 | 8 | = peek() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | Read a byte from the file without advancing to the next one. That is, successive calls to `peek()` will return the same value, as will the next call to `read()`. 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.peek()` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `stream` : an instance of a class that inherits from Stream. 31 | 32 | [float] 33 | === Returns 34 | The next byte (or character), or -1 if none is available. 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 49 | 50 | [float] 51 | === See also 52 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 53 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 54 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 55 | [role="language"] 56 | * #LANGUAGE# link:../streamAvailable[available()] + 57 | * #LANGUAGE# link:../streamRead[read()] 58 | 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/compoundSubtraction.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "-=" 3 | title_expanded: compound subtraction 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = -= Compound Subtraction 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | This is a convenient shorthand to perform subtraction of a constant or a variable from a variable. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x -= y; // equivalent to the expression x = x - y; 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | x = 20; 52 | x -= 2; // x now contains 18 53 | ---- 54 | [%hardbreaks] 55 | 56 | [float] 57 | === Notes and Warnings 58 | [%hardbreaks] 59 | 60 | [float] 61 | === See also 62 | 63 | [role="language"] 64 | * #LANGUAGE# link:../../arithmetic-operators/subtraction[Normal Subtraction] 65 | * #LANGUAGE# link:../compoundAddition[Compound Addition] 66 | * #LANGUAGE# link:../compoundMultiplication[Compound Multiplication] 67 | * #LANGUAGE# link:../compoundDivision[Compound Division] 68 | 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/compoundDivision.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "/=" 3 | title_expanded: compound division 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = /= Compound Division 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | This is a convenient shorthand to perform division of a variable with another constant or variable. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x /= y; // equivalent to the expression x = x / y; 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: *non zero* variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | x = 2; 52 | x /= 2; // x now contains 1 53 | ---- 54 | [%hardbreaks] 55 | 56 | [float] 57 | === Notes and Warnings 58 | [%hardbreaks] 59 | 60 | [float] 61 | === See also 62 | 63 | [role="language"] 64 | * #LANGUAGE# link:../../arithmetic-operators/division[Normal Division] 65 | * #LANGUAGE# link:../compoundAddition[Compound Addition] 66 | * #LANGUAGE# link:../compoundSubtraction[Compound Subtraction] 67 | * #LANGUAGE# link:../compoundMultiplication[Compound Multiplication] 68 | 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Structure/Compound Operators/compoundMultiplication.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "*=" 3 | title_expanded: compound multiplication 4 | categories: [ "Structure" ] 5 | subCategories: [ "Compound Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = *= Compound Multiplication 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | This is a convenient shorthand to perform multiplication of a variable with another constant or variable. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x *= y; // equivalent to the expression x = x * y; 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | x = 2; 52 | x *= 2; // x now contains 4 53 | ---- 54 | [%hardbreaks] 55 | 56 | [float] 57 | === Notes and Warnings 58 | [%hardbreaks] 59 | 60 | [float] 61 | === See also 62 | 63 | [role="language"] 64 | * #LANGUAGE# link:../../arithmetic-operators/multiplication[Normal Multiplication] 65 | * #LANGUAGE# link:../compoundAddition[Compound Addition] 66 | * #LANGUAGE# link:../compoundSubtraction[Compound Subtraction] 67 | * #LANGUAGE# link:../compoundDivision[Compound Division] 68 | 69 | -- 70 | // HOW TO USE SECTION ENDS 71 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamReadStringUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.readStringUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = readStringUntil() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `readStringUntil()` reads characters from a stream into a string. The function terminates if the terminator character is detected or it times out (see link:../streamSetTimeout[setTimeout()]). 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.readString(terminator)` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `terminator` : the character to search for (`char`) 31 | 32 | [float] 33 | === Returns 34 | The entire string read from a stream, until the terminator character is detected. 35 | 36 | -- 37 | // OVERVIEW SECTION ENDS 38 | 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 49 | 50 | [float] 51 | === See also 52 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 53 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 54 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 55 | [role="language"] 56 | * #LANGUAGE# link:../../stream[stream] 57 | -- 58 | // HOW TO USE SECTION ENDS 59 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/lessThan.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "<" 3 | title_expanded: less thans 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = < Less Than 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Tests if the string on the left is less than the string on the right. This operator evaluate strings in alphabetical order, on the first character where the two differ. So, for example "a" < "b" and "1" < "2", but "999" > "1000" because 9 comes after 1. 23 | 24 | Caution: String comparison operators can be confusing when you're comparing numeric strings, because the numbers are treated as strings and not as numbers. If you need to compare numbers numerically, compare them as ints, floats, or longs, and not as Strings. 25 | 26 | [%hardbreaks] 27 | 28 | 29 | [float] 30 | === Syntax 31 | [source,arduino] 32 | ---- 33 | string1 < string2 34 | ---- 35 | 36 | [float] 37 | === Parameters 38 | `string1, string2`: variables of type String 39 | 40 | [float] 41 | === Returns 42 | `true`: if string1 is greater than string2 43 | 44 | `false`: otherwise 45 | -- 46 | 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/greaterThan.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: ">" 3 | title_expanded: greater than 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = > Greater Than 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Tests if the string on the left is greater than the string on the right. This operator evaluates strings in alphabetical order, on the first character where the two differ. So, for example "b" > "a" and "2" > "1", but "999" > "1000" because 9 comes after 1. 23 | 24 | Caution: String comparison operators can be confusing when you're comparing numeric strings, because the numbers are treated as strings and not as numbers. If you need to compare numbers numerically, compare them as ints, floats, or longs, and not as Strings. 25 | [%hardbreaks] 26 | 27 | 28 | [float] 29 | === Syntax 30 | [source,arduino] 31 | ---- 32 | string1 > string2 33 | ---- 34 | 35 | [float] 36 | === Parameters 37 | `string1, string2` - a string variable 38 | 39 | [float] 40 | === Returns 41 | `true`: if string1 is greater than string2 42 | 43 | `false`: otherwise 44 | 45 | -- 46 | 47 | // OVERVIEW SECTION ENDS 48 | 49 | 50 | 51 | // HOW TO USE SECTION ENDS 52 | 53 | 54 | // SEE ALSO SECTION 55 | [#see_also] 56 | -- 57 | 58 | [float] 59 | === See also 60 | 61 | [role="example"] 62 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 63 | -- 64 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamParseFloat.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.parseFloat() 3 | --- 4 | 5 | 6 | 7 | 8 | = parseFloat() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `parseFloat()` returns the first valid floating point number from the current position. Initial characters that are not digits (or the minus sign) are skipped. `parseFloat()` is terminated by the first character that is not a floating point number. 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more informatio 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | `stream.parseFloat(list)` 26 | 27 | 28 | [float] 29 | === Parameters 30 | `stream` : an instance of a class that inherits from Stream. 31 | 32 | `list` : the stream to check for floats (`char`) 33 | 34 | [float] 35 | === Returns 36 | `float` 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 51 | 52 | [float] 53 | === See also 54 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 55 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 56 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | [role="language"] 58 | * #LANGUAGE# link:../../stream[stream] 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/lessThan.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "<" 3 | title_expanded: less than 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = < Less Than 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is less (smaller) than the operand on the right. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x < y; // is true if x is smaller than y and it is false if x is equal or bigger than y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x" 3 | title_expanded: greater than 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = > Greater than 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is greater (bigger) than the operand on the right. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x > y; // is true if x is bigger than y and it is false if x is equal or smaller than y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x>y) // tests if x is greater (bigger) than y 52 | { 53 | // do something only if the comparison result is true 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === Notes and Warnings 60 | Positive numbers are greater than negative numbers. 61 | [%hardbreaks] 62 | 63 | [float] 64 | === See also 65 | 66 | [role="language"] 67 | * #LANGUAGE# link:../equalto[Comparison Equal To] 68 | * #LANGUAGE# link:../notequalto[Comparison Not Equal To] 69 | * #LANGUAGE# link:../lessthan[Comparison Less Than] 70 | -- 71 | // HOW TO USE SECTION ENDS 72 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/return.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: return 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = return 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Terminate a function and return a value from a function to the calling function, if desired. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | [source,arduino] 27 | ---- 28 | return; 29 | 30 | return value; // both forms are valid 31 | ---- 32 | 33 | 34 | [float] 35 | === Parameters 36 | `value': any variable or constant type 37 | 38 | -- 39 | // OVERVIEW SECTION ENDS 40 | 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | A function to compare a sensor input to a threshold 51 | 52 | [source,arduino] 53 | ---- 54 | int checkSensor(){ 55 | if (analogRead(0) > 400) { 56 | return 1; 57 | else{ 58 | return 0; 59 | } 60 | } 61 | ---- 62 | 63 | The return keyword is handy to test a section of code without having to "comment out" large sections of possibly buggy code. 64 | [source,arduino] 65 | ---- 66 | void loop(){ 67 | 68 | // brilliant code idea to test here 69 | 70 | return; 71 | 72 | // the rest of a dysfunctional sketch here 73 | // this code will never be executed 74 | } 75 | ---- 76 | [%hardbreaks] 77 | 78 | 79 | [float] 80 | === See also 81 | [role="language"] 82 | * #LANGUAGE# link:../break[break] 83 | * #LANGUAGE# link:../continue[continue] 84 | 85 | -- 86 | // HOW TO USE SECTION ENDS 87 | -------------------------------------------------------------------------------- /Language/Structure/Further Syntax/include.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "#include" 3 | title_expanded: include 4 | categories: [ "Structure" ] 5 | subCategories: [ "Further Syntax" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = #include 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | `#include` is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for Arduino. 22 | [%hardbreaks] 23 | 24 | The main reference page for AVR C libraries (AVR is a reference to the Atmel chips on which the Arduino is based) is http://www.nongnu.org/avr-libc/user-manual/modules.html[here^]. 25 | [%hardbreaks] 26 | 27 | Note that `#include`, similar to link:../define[`#define`], has no semicolon terminator, and the compiler will yield cryptic error messages if you add one. 28 | [%hardbreaks] 29 | 30 | -- 31 | // OVERVIEW SECTION ENDS 32 | 33 | 34 | 35 | 36 | // HOW TO USE SECTION STARTS 37 | [#howtouse] 38 | -- 39 | 40 | [float] 41 | === Example Code 42 | This example includes a library that is used to put data into the program space _flash_ instead of _ram_. This saves the ram space for dynamic memory needs and makes large lookup tables more practical. 43 | 44 | 45 | [source,arduino] 46 | ---- 47 | #include 48 | 49 | prog_uint16_t myConstants[] PROGMEM = {0, 21140, 702 , 9128, 0, 25764, 8456, 50 | 0,0,0,0,0,0,0,0,29810,8968,29762,29762,4500}; 51 | ---- 52 | [%hardbreaks] 53 | 54 | 55 | [float] 56 | === See also 57 | 58 | 59 | -- 60 | // HOW TO USE SECTION ENDS 61 | -------------------------------------------------------------------------------- /Language/Functions/Math/constrain.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: constrain() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Math" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = constrain(x, a, b) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Constrains a number to be within a range. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `constrain(x, a, b)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `x`: the number to constrain, all data types 32 | `a`: the lower end of the range, all data types 33 | `b`: the upper end of the range, all data types 34 | 35 | [float] 36 | === Returns 37 | x: if x is between a and b 38 | 39 | a: if x is less than a 40 | 41 | b: if x is greater than b 42 | 43 | -- 44 | // OVERVIEW SECTION ENDS 45 | 46 | 47 | 48 | 49 | // HOW TO USE SECTION STARTS 50 | [#howtouse] 51 | -- 52 | 53 | [float] 54 | === Example Code 55 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 56 | The code limits the sensor values to between 10 to 150. 57 | 58 | [source,arduino] 59 | ---- 60 | sensVal = constrain(sensVal, 10, 150); // limits range of sensor values to between 10 and 150 61 | ---- 62 | [%hardbreaks] 63 | 64 | 65 | [float] 66 | === See also 67 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 68 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 69 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 70 | [role="language"] 71 | * #LANGUAGE# link:../min[min()] + 72 | * #LANGUAGE# link:../max[max()] 73 | 74 | 75 | -- 76 | // HOW TO USE SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/lessThanOrEqualTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "<=" 3 | title_expanded: less than or equal 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = <= Less Than Or Equal 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Tests if the string on the left is less than or equal to the string on the right. This operator evaluate strings in alphabetical order, on the first character where the two differ. So, for example "a" < "b" and "1" < "2", but "999" > "1000" because 9 comes after 1. 23 | 24 | Caution: String comparison operators can be confusing when you're comparing numeric strings, because the numbers are treated as strings and not as numbers. If you need to compare numbers numerically, compare them as ints, floats, or longs, and not as Strings. 25 | 26 | [%hardbreaks] 27 | 28 | 29 | [float] 30 | === Syntax 31 | [source,arduino] 32 | ---- 33 | string1 <= string2 34 | ---- 35 | 36 | [float] 37 | === Parameters 38 | `string1, string2`: variables of type String 39 | 40 | [float] 41 | === Returns 42 | `true`: if string1 is less than or equal to string2 43 | 44 | `false`: otherwise 45 | 46 | -- 47 | 48 | // OVERVIEW SECTION ENDS 49 | 50 | 51 | 52 | // HOW TO USE SECTION ENDS 53 | 54 | 55 | // SEE ALSO SECTION 56 | [#see_also] 57 | -- 58 | 59 | [float] 60 | === See also 61 | 62 | [role="example"] 63 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 64 | -- 65 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Operators/greaterThanOrEqualTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: ">=" 3 | title_expanded: greater than or equal to 4 | categories: [ "Data Types" ] 5 | subCategories: [ "StringObject Operator" ] 6 | --- 7 | 8 | :source-highlighter: pygments 9 | :pygments-style: arduino 10 | 11 | 12 | 13 | = >= Greater Than Or Equal To 14 | 15 | 16 | // OVERVIEW SECTION STARTS 17 | [#overview] 18 | -- 19 | 20 | [float] 21 | === Description 22 | Tests if the string on the left is greater than the string on the right. This operator evaluate strings in alphabetical order, on the first character where the two differ. So, for example "b" >= "a" and "2" >= "1", but "999" >= "1000" because 9 comes after 1. 23 | 24 | Caution: String comparison operators can be confusing when you're comparing numeric strings, because the numbers are treated as strings and not as numbers. If you need to compare numbers numerically, compare them as ints, floats, or longs, and not as Strings. 25 | 26 | [%hardbreaks] 27 | 28 | 29 | [float] 30 | === Syntax 31 | [source,arduino] 32 | ---- 33 | string1 >= string2 34 | ---- 35 | 36 | [float] 37 | === Parameters 38 | `string1, string2`: variables of type String 39 | 40 | 41 | [float] 42 | === Returns 43 | `true`: if string1 is greater than or equal to string2 44 | 45 | `false`: otherwise 46 | -- 47 | 48 | // OVERVIEW SECTION ENDS 49 | 50 | 51 | 52 | // HOW TO USE SECTION ENDS 53 | 54 | 55 | // SEE ALSO SECTION 56 | [#see_also] 57 | -- 58 | 59 | [float] 60 | === See also 61 | 62 | [role="example"] 63 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 64 | -- 65 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Functions/Math/pow.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: pow() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Math" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = pow(base, exponent) 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Calculates the value of a number raised to a power. `Pow()` can be used to raise a number to a fractional power. This is useful for generating exponential mapping of values or curves. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `pow(base, exponent)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `base`: the number (`float`) 32 | 33 | `exponent`: the power to which the base is raised (`float`) 34 | 35 | [float] 36 | === Returns 37 | The result of the exponentiation. (`double`) 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | 45 | // HOW TO USE SECTION STARTS 46 | [#howtouse] 47 | -- 48 | 49 | [float] 50 | === Example Code 51 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | See the (http://arduino.cc/playground/Main/Fscale[fscale]) function in the code library. 53 | [%hardbreaks] 54 | 55 | [float] 56 | === See also 57 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 58 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 59 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 60 | [role="language"] 61 | * #LANGUAGE# link:../sqrt[sqrt()] 62 | 63 | [role="definition"] 64 | * #DEFINITION# link:../../../Variables/data-types/float[float] + 65 | * #DEFENITION# link:../../../Variables/data-types/double[double] 66 | 67 | -- 68 | // HOW TO USE SECTION ENDS 69 | -------------------------------------------------------------------------------- /Language/Functions/Communication/stream.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: stream 3 | categories: [ "Functions" ] 4 | subCategories: [ "Communication" ] 5 | --- 6 | 7 | 8 | 9 | 10 | = Stream 11 | 12 | 13 | // OVERVIEW SECTION STARTS 14 | [#overview] 15 | -- 16 | 17 | [float] 18 | === Description 19 | Stream is the base class for character and binary based streams. It is not called directly, but invoked whenever you use a function that relies on it. 20 | 21 | Stream defines the reading functions in Arduino. When using any core functionality that uses a `read()` or similar method, you can safely assume it calls on the Stream class. For functions like `print()`, Stream inherits from the Print class. 22 | 23 | Some of the libraries that rely on Stream include : 24 | 25 | * link:../serial[Serial] + 26 | * link:../[Wire] + 27 | * link:../[Ethernet Client] + 28 | * link:../[Ethernet Server] + 29 | * link:../[SD] 30 | 31 | 32 | -- 33 | // OVERVIEW SECTION ENDS 34 | 35 | 36 | // FUNCTIONS SECTION STARTS 37 | [#functions] 38 | -- 39 | 40 | ''' 41 | 42 | [float] 43 | === Functions 44 | link:../stream/streamAvailable[available()] + 45 | link:../stream/streamRead[read()] + 46 | link:../stream/streamFlush[flush()] + 47 | link:../stream/streamFind[find()] + 48 | link:../stream/streamFindUntil[findUntil()] + 49 | link:../stream/streamPeek[peek()] + 50 | link:../stream/streamReadBytes[readBytes()] + 51 | link:../stream/streamReadBytesUntil[readBytesUntil()] + 52 | link:../stream/streamReadString[readString()] + 53 | link:../stream/streamReadStringUntil[readStringUntil()] + 54 | link:../stream/streamParseInt[parseInt()] + 55 | link:../stream/streamParseFloat[parseFloat()] + 56 | link:../stream/streamSetTimeout[setTimeout()] 57 | 58 | ''' 59 | 60 | -- 61 | // FUNCTIONS SECTION ENDS 62 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/bool.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: bool 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = bool 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | A `bool` holds one of two values, `true` or `false`. (Each `bool` variable occupies one byte of memory.) 21 | 22 | 23 | [%hardbreaks] 24 | 25 | -- 26 | // OVERVIEW SECTION ENDS 27 | 28 | 29 | 30 | 31 | // HOW TO USE SECTION STARTS 32 | [#howtouse] 33 | -- 34 | 35 | [float] 36 | === Example Code 37 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 38 | This code shows how to use the `bool` datatype. 39 | 40 | [source,arduino] 41 | ---- 42 | int LEDpin = 5; // LED on pin 5 43 | int switchPin = 13; // momentary switch on 13, other side connected to ground 44 | 45 | bool running = false; 46 | 47 | void setup() 48 | { 49 | pinMode(LEDpin, OUTPUT); 50 | pinMode(switchPin, INPUT); 51 | digitalWrite(switchPin, HIGH); // turn on pullup resistor 52 | } 53 | 54 | void loop() 55 | { 56 | if (digitalRead(switchPin) == LOW) 57 | { // switch is pressed - pullup keeps pin high normally 58 | delay(100); // delay to debounce switch 59 | running = !running; // toggle running variable 60 | digitalWrite(LEDpin, running); // indicate via LED 61 | } 62 | } 63 | ---- 64 | 65 | -- 66 | // HOW TO USE SECTION ENDS 67 | 68 | 69 | // SEE ALSO SECTION STARTS 70 | [#see_also] 71 | -- 72 | 73 | [float] 74 | === See also 75 | 76 | [role="language"] 77 | * #LANGUAGE# link:../../../variables/constants/constants[constants] 78 | 79 | -- 80 | // SEE ALSO SECTION ENDS 81 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/short.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: short 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = short 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | A short is a 16-bit data-type. 21 | 22 | On all Arduinos (ATMega and ARM based) a short stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1). 23 | [%hardbreaks] 24 | 25 | [float] 26 | === Syntax 27 | `short var = val;` 28 | 29 | `var` - your short variable name 30 | `val` - the value you assign to that variable 31 | -- 32 | // OVERVIEW SECTION ENDS 33 | 34 | 35 | 36 | 37 | // HOW TO USE SECTION STARTS 38 | [#howtouse] 39 | -- 40 | 41 | [float] 42 | === Example Code 43 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 44 | 45 | 46 | [source,arduino] 47 | ---- 48 | short ledPin = 13 49 | ---- 50 | [%hardbreaks] 51 | 52 | 53 | [float] 54 | === See also 55 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 56 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 57 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 58 | [role="definition"] 59 | * #DEFINITION# link:../byte[byte] + 60 | * #DEFINITION# link:../int[int] + 61 | * #DEFINITION# link:../unsignedInt[unsigned int] + 62 | * #DEFINITION# link:../long[long] + 63 | * #DEFINITION# link:../unsignedLong[unsigned long] + 64 | * #DEFINITION# link:../../constants/integerConstants[Integer Constants] + 65 | * #DEFINITION# link:../unsignedInt[unsigned int] + 66 | 67 | -- 68 | // HOW TO USE SECTION ENDS 69 | -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/lessThanOrEqualTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "<=" 3 | title_expanded: less than or equal to 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = <= Less Than or Equal To 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is less (smaller) than or equal to the operand on the right. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x <= y; // is true if x is smaller than or equal to y and it is false if x is greater than y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x<=y) // tests if x is less (smaller) than or equal to y 52 | { 53 | // do something only if the comparison result is true 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === Notes and Warnings 60 | Negative numbers are smaller than positive numbers. 61 | [%hardbreaks] 62 | 63 | [float] 64 | === See also 65 | 66 | [role="language"] 67 | * #LANGUAGE# link:../equalto[Comparison Equal To] 68 | * #LANGUAGE# link:../notequalto[Comparison Not Equal To] 69 | * #LANGUAGE# link:../lessthan[Comparison Less Than] 70 | * #LANGUAGE# link:../greaterthan[Comparison Greater Than] 71 | -- 72 | // HOW TO USE SECTION ENDS 73 | -------------------------------------------------------------------------------- /Language/Structure/Comparison Operators/greaterThanOrEqualTo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: ">=" 3 | title_expanded: greater than or equal to 4 | categories: [ "Structure" ] 5 | subCategories: [ "Comparison Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = >= Greater Than or Equal To 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is greater (bigger) than or equal to the operand on the right. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | x >= y; // is true if x is bigger than or equal to y and it is false if x is smaller than y 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `x`: variable. *Allowed data types:* int, float, double, byte, short, long + 35 | `y`: variable or constant. *Allowed data types:* int, float, double, byte, short, long 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | // HOW TO USE SECTION STARTS 43 | [#howtouse] 44 | -- 45 | 46 | [float] 47 | === Example Code 48 | 49 | [source,arduino] 50 | ---- 51 | if (x>=y) // tests if x is greater (bigger) than or equal to y 52 | { 53 | // do something only if the comparison result is true 54 | } 55 | ---- 56 | [%hardbreaks] 57 | 58 | [float] 59 | === Notes and Warnings 60 | Positive numbers are greater than negative numbers. 61 | [%hardbreaks] 62 | 63 | [float] 64 | === See also 65 | 66 | [role="language"] 67 | * #LANGUAGE# link:../equalto[Comparison Equal To] 68 | * #LANGUAGE# link:../notequalto[Comparison Not Equal To] 69 | * #LANGUAGE# link:../lessthan[Comparison Less Than] 70 | * #LANGUAGE# link:../greaterthan[Comparison Greater Than] 71 | -- 72 | // HOW TO USE SECTION ENDS 73 | -------------------------------------------------------------------------------- /Language/Functions/Analog IO/analogReference.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: analogReference() 3 | categories: [ "Functions" ] 4 | subCategories: [ "アナログ入出力" ] 5 | --- 6 | 7 | 8 | // 9 | 10 | 11 | = analogReference() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | アナログ入力で使用する基準電圧を設定します.(例として,入力レンジの最大値を決めることが可能) 21 | 22 | 以下が選択可能です: 23 | 24 | * DEFAULT: 標準の基準電圧,5V(5V使用のArduinoの場合)または3.3V(3.3V使用のArduinoの場合) 25 | * INTERNAL: 内蔵の基準電圧(Arduino Megaでは使用不可),ATmega168またはATmega328使用のArduinoは1.1V,ATmega8使用のArduinoは2.56V 26 | * INTERNAL1V1: 内蔵の基準電圧(Arduino Megaのみ),1.1V 27 | * INTERNAL2V56: 内蔵の基準電圧(Arduino Megaのみ),2.56V 28 | * EXTERNAL: AREFピンに入力されている電圧を基準電圧として使用(0-5Vまで) 29 | [%hardbreaks] 30 | 31 | 32 | [float] 33 | === 構文 34 | `analogReference(type)` 35 | 36 | 37 | [float] 38 | === パラメータ 39 | `type`: 使用する基準電圧の種類(DEFAULT, INTERNAL, INTERNAL1V1, INTERNAL2V56またはEXTERNAL) 40 | 41 | [float] 42 | === 戻り値 43 | なし 44 | 45 | -- 46 | // OVERVIEW SECTION ENDS 47 | 48 | 49 | 50 | 51 | // HOW TO USE SECTION STARTS 52 | [#howtouse] 53 | -- 54 | 55 | [float] 56 | === 注意 57 | 基準電圧を変更した後の,最初の数回のanalogRead()の値は正確でない可能性があります. 58 | 59 | *0V以下または5V以上の電圧をAREFピンに入力しないでください! AREFピンを外部基準電圧として使用する場合は,analogRead()を呼び出す前に基準電圧のモードを「EXTERNAL」に設定する必要があります.設定しなかった場合は,内部で生成している基準とAREFピンがショートし,Arduinoの基板を破壊する可能性があります. 60 | 61 | さらに,基準電圧を5kΩの抵抗を介してAREFピンに接続することで,内部と外部の基準電圧を切り替えられるようになります.だだし,AREFピンには32kΩの抵抗があり,これによって抵抗分圧の働きをするため,基準電圧が変化することに注意してください.例えば,2.5Vを入力した場合には,AREFピンでは約2.2Vとなります.(式:2.5 * 32 / (32 + 5) = ~2.2V) 62 | 63 | -- 64 | // HOW TO USE SECTION ENDS 65 | 66 | 67 | // SEE ALSO SECTION 68 | [#see_also] 69 | -- 70 | 71 | [float] 72 | === 参照 73 | 74 | [role="example"] 75 | * #EXAMPLE# http://arduino.cc/en/Tutorial/AnalogInputPins[Description of analog input pins] 76 | 77 | -- 78 | // SEE ALSO SECTION ENDS 79 | -------------------------------------------------------------------------------- /Language/Functions/USB/Mouse/mouseBegin.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mouse.begin() 3 | --- 4 | 5 | 6 | 7 | 8 | 9 | = Mouse.begin() 10 | 11 | 12 | // OVERVIEW SECTION STARTS 13 | [#overview] 14 | -- 15 | 16 | [float] 17 | === Description 18 | Begins emulating the mouse connected to a computer. `begin()` must be called before controlling the computer. To end control, use link:../mouseEnd[Mouse.end()]. 19 | [%hardbreaks] 20 | 21 | 22 | [float] 23 | === Syntax 24 | `Mouse.begin()` 25 | 26 | 27 | [float] 28 | === Parameters 29 | Nothing 30 | 31 | [float] 32 | === Returns 33 | Nothing 34 | 35 | -- 36 | // OVERVIEW SECTION ENDS 37 | 38 | 39 | 40 | 41 | // HOW TO USE SECTION STARTS 42 | [#howtouse] 43 | -- 44 | 45 | [float] 46 | === Example Code 47 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 48 | 49 | 50 | [source,arduino] 51 | ---- 52 | void setup(){ 53 | pinMode(2, INPUT); 54 | } 55 | 56 | void loop(){ 57 | 58 | //initiate the Mouse library when button is pressed 59 | if(digitalRead(2) == HIGH){ 60 | Mouse.begin(); 61 | } 62 | 63 | } 64 | ---- 65 | [%hardbreaks] 66 | 67 | [float] 68 | === See also 69 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 70 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 71 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 72 | [role="language"] 73 | * #LANGUAGE# link:../mouseClick[Mouse.click] + 74 | * #LANGUAGE# link:../mouseEnd[Mouse.end] + 75 | * #LANGUAGE# link:../mouseMove[Mouse.move] + 76 | * #LANGUAGE# link:../mousePress[Mouse.press] + 77 | * #LANGUAGE# link:../mouseRelease[Mouse.release] + 78 | * #LANGUAGE# link:../mouseIsPressed[Mouse.releaseAll] 79 | 80 | -- 81 | // HOW TO USE SECTION ENDS 82 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamReadBytes.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.readBytes() 3 | --- 4 | 5 | 6 | 7 | 8 | = readBytes() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `readBytes()` read characters from a stream into a buffer. The function terminates if the determined length has been read, or it times out (see link:../streamSetTimeout[setTimeout()]). 18 | 19 | `readBytes()` returns the number of bytes placed in the buffer. A 0 means no valid data was found. 20 | 21 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | `stream.readBytes(buffer, length)` 28 | 29 | 30 | [float] 31 | === Parameters 32 | `stream` : an instance of a class that inherits from Stream. 33 | 34 | `buffer` : the buffer to store the bytes in (`char[]` or `byte[]`) 35 | 36 | `length` : the number of bytes to `read(int)` 37 | 38 | [float] 39 | === Returns 40 | The number of bytes placed in the buffer. 41 | 42 | -- 43 | // OVERVIEW SECTION ENDS 44 | 45 | 46 | 47 | 48 | // HOW TO USE SECTION STARTS 49 | [#howtouse] 50 | -- 51 | 52 | [float] 53 | === Example Code 54 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 55 | 56 | [float] 57 | === See also 58 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 59 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 60 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 61 | [role="language"] 62 | * #LANGUAGE# link:../../stream[stream] 63 | 64 | -- 65 | // HOW TO USE SECTION ENDS 66 | -------------------------------------------------------------------------------- /Language/Structure/Pointer Access Operators/reference.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "&" 3 | title_expanded: reference operator 4 | categories: [ "Structure" ] 5 | subCategories: [ "Pointer Access Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = & Reference Operator 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Referencing is one of the features specifically for use with pointers. The ampersand operator `&` is used for this purpose. If `x` is a variable, then `&x` represents the address of the variable `x`. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | 36 | [source,arduino] 37 | ---- 38 | int *p; // declare a pointer to an int data type 39 | int i = 5, result = 0; 40 | p = &i; // now 'p' contains the address of 'i' 41 | result = *p; // 'result' gets the value at the address pointed by 'p' 42 | // i.e., it gets the value of 'i' which is 5 43 | ---- 44 | [%hardbreaks] 45 | 46 | [float] 47 | === Notes and Warnings 48 | Pointers are one of the complicated subjects for beginners in learning C, and it is possible to write the vast majority of Arduino sketches without ever encountering pointers. However for manipulating certain data structures, the use of pointers can simplify the code, and and knowledge of manipulating pointers is handy to have in one's toolkit. 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | 54 | [role="language"] 55 | * #LANGUAGE# link:../dereference[* Dereference Operator] 56 | 57 | [role="definition"] 58 | * #DEFINITION# http://en.wikipedia.org/wiki/Pointer_%28computer_programming%29[Pointers^] 59 | 60 | -- 61 | // HOW TO USE SECTION ENDS 62 | -------------------------------------------------------------------------------- /Language/Functions/Interrupts/noInterrupts.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: noInterrupts() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Interrupts" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = noInterrupts() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Disables interrupts (you can re-enable them with `interrupts()`). Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `noInterrupts()` 27 | 28 | 29 | [float] 30 | === Parameters 31 | Nothing 32 | 33 | [float] 34 | === Returns 35 | Nothing 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === Example Code 49 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 50 | The code shows how to enable interrupts. 51 | 52 | [source,arduino] 53 | ---- 54 | void setup() {} 55 | 56 | void loop() 57 | { 58 | noInterrupts(); 59 | // critical, time-sensitive code here 60 | interrupts(); 61 | // other code here 62 | } 63 | ---- 64 | [%hardbreaks] 65 | 66 | [float] 67 | === See also 68 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 69 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 70 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 71 | [role="language"] 72 | * #LANGUAGE# link:../interrupts[interrupts()] 73 | 74 | 75 | -- 76 | // HOW TO USE SECTION ENDS 77 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/readString.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.readString() 3 | --- 4 | 5 | 6 | 7 | 8 | = readString() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `Serial.readString()` reads characters from the serial buffer into a string. The function terminates if it times out (see link:../setTimeout[setTimeout()]). 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 20 | 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `Serial.readString()` 27 | 28 | 29 | [float] 30 | === Parameters 31 | Nothing 32 | 33 | [float] 34 | === Returns 35 | A string read from the serial buffer 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../serial[Serial] + 54 | * #LANGUAGE# link:../begin[begin()] + 55 | * #LANGUAGE# link:../end[end()] + 56 | * #LANGUAGE# link:../available[available()] + 57 | * #LANGUAGE# link:../read[read()] + 58 | * #LANGUAGE# link:../peek[peek()] + 59 | * #LANGUAGE# link:../flush[flush()] + 60 | * #LANGUAGE# link:../print[print()] + 61 | * #LANGUAGE# link:../println[println()] + 62 | * #LANGUAGE# link:../write[write()] + 63 | * #LANGUAGE# link:../serialEvent[SerialEvent()] + 64 | * #LANGUAGE# link:../../stream/streamParseFloat[Stream.parseFloat()] 65 | 66 | -- 67 | // HOW TO USE SECTION ENDS 68 | -------------------------------------------------------------------------------- /Language/Structure/Pointer Access Operators/dereference.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "*" 3 | title_expanded: dereference operator 4 | categories: [ "Structure" ] 5 | subCategories: [ "Pointer Access Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = * Dereference Operator 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | Dereferencing is one of the features specifically for use with pointers. The asterisk operator `*` is used for this purpose. If `p` is a pointer, then `*p` represents the value contained in the address pointed by `p`. 22 | [%hardbreaks] 23 | 24 | -- 25 | // OVERVIEW SECTION ENDS 26 | 27 | 28 | 29 | // HOW TO USE SECTION STARTS 30 | [#howtouse] 31 | -- 32 | 33 | [float] 34 | === Example Code 35 | 36 | [source,arduino] 37 | ---- 38 | int *p; // declare a pointer to an int data type 39 | int i = 5, result = 0; 40 | p = &i; // now 'p' contains the address of 'i' 41 | result = *p; // 'result' gets the value at the address pointed by 'p' 42 | // i.e., it gets the value of 'i' which is 5 43 | ---- 44 | [%hardbreaks] 45 | 46 | [float] 47 | === Notes and Warnings 48 | Pointers are one of the complicated subjects for beginners in learning C, and it is possible to write the vast majority of Arduino sketches without ever encountering pointers. However for manipulating certain data structures, the use of pointers can simplify the code, and and knowledge of manipulating pointers is handy to have in one's toolkit. 49 | [%hardbreaks] 50 | 51 | [float] 52 | === See also 53 | 54 | [role="language"] 55 | * #LANGUAGE# link:../reference[& Reference Operator] 56 | 57 | [role="definition"] 58 | * #DEFINITION# http://en.wikipedia.org/wiki/Pointer_%28computer_programming%29[Pointers^] 59 | 60 | -- 61 | // HOW TO USE SECTION ENDS 62 | -------------------------------------------------------------------------------- /Language/Functions/USB/Mouse/mouseEnd.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mouse.end() 3 | --- 4 | 5 | 6 | 7 | 8 | = Mouse.end() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | Stops emulating the mouse connected to a computer. To start control, use link:../mouseBegin[Mouse.begin()]. 18 | [%hardbreaks] 19 | 20 | 21 | [float] 22 | === Syntax 23 | `Mouse.end()` 24 | 25 | 26 | [float] 27 | === Parameters 28 | Nothing 29 | 30 | [float] 31 | === Returns 32 | Nothing 33 | 34 | -- 35 | // OVERVIEW SECTION ENDS 36 | 37 | 38 | 39 | 40 | // HOW TO USE SECTION STARTS 41 | [#howtouse] 42 | -- 43 | 44 | [float] 45 | === Example Code 46 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 47 | 48 | 49 | [source,arduino] 50 | ---- 51 | void setup(){ 52 | pinMode(2,INPUT); 53 | //initiate the Mouse library 54 | Mouse.begin(); 55 | } 56 | 57 | void loop(){ 58 | //if the button is pressed, send a Right mouse click 59 | //then end the Mouse emulation 60 | if(digitalRead(2) == HIGH){ 61 | Mouse.click(); 62 | Mouse.end(); 63 | } 64 | } 65 | 66 | ---- 67 | [%hardbreaks] 68 | 69 | 70 | [float] 71 | === See also 72 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 73 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 74 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 75 | [role="language"] 76 | * #LANGUAGE# link:../mouseClick[Mouse.click] + 77 | * #LANGUAGE# link:../mouseEnd[Mouse.end] + 78 | * #LANGUAGE# link:../mouseMove[Mouse.move] + 79 | * #LANGUAGE# link:../mousePress[Mouse.press] + 80 | * #LANGUAGE# link:../mouseRelease[Mouse.release] + 81 | * #LANGUAGE# link:../mouseIsPressed[Mouse.releaseAll] 82 | 83 | -- 84 | // HOW TO USE SECTION ENDS 85 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/String/Functions/reserve.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "reserve()" 3 | categories: [ "Data Types" ] 4 | subCategories: [ "StringObject Function" ] 5 | --- 6 | 7 | :source-highlighter: pygments 8 | :pygments-style: arduino 9 | 10 | 11 | 12 | = reserve() 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | The String reserve() function allows you to allocate a buffer in memory for manipulating strings. 22 | 23 | [%hardbreaks] 24 | 25 | 26 | [float] 27 | === Syntax 28 | [source,arduino] 29 | ---- 30 | string.reserve(size) 31 | ---- 32 | 33 | [float] 34 | === Parameters 35 | `size`: unsigned int declaring the number of bytes in memory to save for string manipulation 36 | 37 | 38 | [float] 39 | === Returns 40 | None 41 | -- 42 | // OVERVIEW SECTION ENDS 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | 51 | [source,arduino] 52 | ---- 53 | String myString; 54 | 55 | void setup() { 56 | // initialize serial and wait for port to open: 57 | Serial.begin(9600); 58 | while (!Serial) { 59 | ; // wait for serial port to connect. Needed for Leonardo only 60 | } 61 | 62 | myString.reserve(26); 63 | myString = "i="; 64 | myString += "1234"; 65 | myString += ", is that ok?"; 66 | 67 | // print the String: 68 | Serial.println(myString); 69 | } 70 | 71 | void loop() { 72 | // nothing to do here 73 | } 74 | 75 | ---- 76 | // HOW TO USE SECTION ENDS 77 | 78 | 79 | // SEE ALSO SECTION 80 | [#see_also] 81 | -- 82 | 83 | [float] 84 | === See also 85 | 86 | [role="example"] 87 | * #EXAMPLE# link: https://www.arduino.cc/en/Tutorial/BuiltInExamples#strings[Built-in String Tutorials] 88 | -- 89 | // SEE ALSO SECTION ENDS 90 | // SEE ALSO SECTION ENDS -------------------------------------------------------------------------------- /Language/Variables/Data Types/long.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: long 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = long 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647. 21 | 22 | If doing math with integers, at least one of the numbers must be followed by an L, forcing it to be a long. See the link:../../constants/integerConstants[Integer Constants] page for details. 23 | [%hardbreaks] 24 | 25 | [float] 26 | === Syntax 27 | 28 | `long var = val;` 29 | 30 | `var` - the long variable name 31 | `val` - the value assigned to the variable 32 | [%hardbreaks] 33 | -- 34 | // OVERVIEW SECTION ENDS 35 | 36 | 37 | 38 | 39 | // HOW TO USE SECTION STARTS 40 | [#howtouse] 41 | -- 42 | 43 | [float] 44 | === Example Code 45 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 46 | 47 | 48 | [source,arduino] 49 | ---- 50 | long speedOfLight = 186000L; // see the Integer Constants page for explanation of the 'L' 51 | ---- 52 | [%hardbreaks] 53 | 54 | 55 | [float] 56 | === See also 57 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 58 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 59 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 60 | [role="definition"] 61 | * #DEFINITION# link:../byte[byte] + 62 | * #DEFINITION# link:../int[int] + 63 | * #DEFINITION# link:../unsignedInt[unsigned int] + 64 | * #DEFINITION# link:../unsignedLong[unsigned long] + 65 | * #DEFINITION# link:../../constants/integerConstants[Integer Constants] + 66 | 67 | 68 | -- 69 | // HOW TO USE SECTION ENDS 70 | -------------------------------------------------------------------------------- /Language/Functions/Advanced IO/tone.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: tone() 3 | categories: [ "Functions" ] 4 | subCategories: [ "応用入出力" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = tone() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === 説明 20 | 指定した周波数の方形波(デューティー比:50%)をピンに生成します.出力時間を指定することができますが,指定しなかった場合は, link:../notone[noTone()] を実行するまで出力を続けます.ピンは,圧電ブザーまたはスピーカに接続して音を鳴らすことができます. 21 | 22 | 同時に生成できるのは,1つの周波数のみです.もし,音がすでに他のピンで鳴らされていた場合,tone()を実行しても効果はありません.もし,音を生成しているピンを指定した場合は,周波数は変更されます. 23 | 24 | `tone()` を使用すると,3番と11番ピンのPWM出力が出来なくなります(Mega以外). 25 | 26 | 31Hzより低い音の生成はできません. 技術的詳細は,こちらをご覧ください https://github.com/bhagman/Tone#ugly-details[Brett Hagman's notes]. 27 | [%hardbreaks] 28 | 29 | 30 | [float] 31 | === 構文 32 | `tone(pin, frequency)` 33 | 34 | `tone(pin, frequency, duration)` 35 | [%hardbreaks] 36 | 37 | [float] 38 | === パラメータ 39 | `pin`: 音を生成するピン 40 | 41 | `frequency`: 音の周波数(Hz) - `unsigned int` 42 | 43 | `duration` (任意): 音の出力時間(マイクロ秒) - `unsigned long` 44 | [%hardbreaks] 45 | 46 | [float] 47 | === 戻り値 48 | なし 49 | 50 | -- 51 | // OVERVIEW SECTION ENDS 52 | 53 | 54 | // HOW TO USE SECTION STARTS 55 | [#howtouse] 56 | -- 57 | 58 | [float] 59 | === 注意 60 | 複数のピンで異なる周波数を生成したい場合は,他のピンで `tone()` を実行する前に `noTone()` を実行する必要があります. 61 | [%hardbreaks] 62 | 63 | -- 64 | // HOW TO USE SECTION ENDS 65 | 66 | 67 | // SEE ALSO SECTION 68 | [#see_also] 69 | -- 70 | 71 | [float] 72 | === 参照 73 | 74 | [role="language"] 75 | * #LANGUAGE# link:../../analog-io/analogwrite[analogWrite()] 76 | 77 | [role="example"] 78 | * #EXAMPLE# http://arduino.cc/en/Tutorial/Tone[Tone^] 79 | * #EXAMPLE# http://arduino.cc/en/Tutorial/Tone[Pitch follower^] 80 | * #EXAMPLE# http://arduino.cc/en/Tutorial/Tone3[Simple Keyboard^] 81 | * #EXAMPLE# http://arduino.cc/en/Tutorial/Tone4[multiple tones^] 82 | * #EXAMPLE# http://arduino.cc/en/Tutorial/PWM[PWM^] 83 | 84 | -- 85 | // SEE ALSO SECTION ENDS 86 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/parseInt.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.parseInt() 3 | --- 4 | 5 | 6 | 7 | 8 | = parseInt() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === 説明 17 | 次の有効なint型の値をシリアルバッファから探します. `stream.parseInt()` は, link:../../stream[Stream] utility classを継承してします. 18 | 19 | 20 | 具体的には: 21 | 22 | * 頭文字が数字以外であったり,マイナス符号の場合はスキップされます. 23 | * 設計可能なタイムアウト時間までに数字が読み込まれていなかったり,数字以外が読み込まれた場合に解析が終了します. 24 | * タイムアウト時(Serial.setTimeout()を参照)までに有効な数字が読み込まれていなかった場合は,0を返します. 25 | [%hardbreaks] 26 | 27 | 28 | [float] 29 | === 構文 30 | `Serial.parseInt()` 31 | `Serial.parseInt(char skipChar)` 32 | 33 | _Arduino Megaのみ:_ 34 | 35 | `Serial1.parseInt()` + 36 | `Serial2.parseInt()` + 37 | `Serial3.parseInt()` 38 | 39 | 40 | [float] 41 | === パラメータ 42 | `skipChar`: 検索でスキップしたい文字.例として,数千もの数の分割文字などに使えます. 43 | 44 | [float] 45 | === 戻り値 46 | `long` : 有効なint型の数字 47 | 48 | -- 49 | // OVERVIEW SECTION ENDS 50 | 51 | 52 | 53 | 54 | // HOW TO USE SECTION STARTS 55 | [#howtouse] 56 | -- 57 | 58 | [float] 59 | === 参照 60 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 61 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 62 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 63 | [role="language"] 64 | * #LANGUAGE# link:../begin[begin()] + 65 | * #LANGUAGE# link:../end[end()] + 66 | * #LANGUAGE# link:../available[available()] + 67 | * #LANGUAGE# link:../read[read()] + 68 | * #LANGUAGE# link:../peek[peek()] + 69 | * #LANGUAGE# link:../flush[flush()] + 70 | * #LANGUAGE# link:../print[print()] + 71 | * #LANGUAGE# link:../println[println()] + 72 | * #LANGUAGE# link:../write[write()] + 73 | * #LANGUAGE# link:../serialEvent[SerialEvent()] + 74 | * #LANGUAGE# link:../../stream/streamParseFloat[Stream.parseFloat()] 75 | 76 | -- 77 | // HOW TO USE SECTION ENDS 78 | -------------------------------------------------------------------------------- /Language/Functions/USB/Keyboard/keyboardEnd.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Keyboard.end() 3 | --- 4 | 5 | 6 | 7 | 8 | = Keyboard.end() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | Stops the keyboard emulation to a connected computer. To start keyboard emulation, use link:../keyboardBegin[Keyboard.begin()]. 18 | [%hardbreaks] 19 | 20 | 21 | [float] 22 | === Syntax 23 | `Keyboard.end()` 24 | 25 | 26 | [float] 27 | === Parameters 28 | Nothing 29 | 30 | [float] 31 | === Returns 32 | Nothing 33 | 34 | -- 35 | // OVERVIEW SECTION ENDS 36 | 37 | 38 | 39 | 40 | // HOW TO USE SECTION STARTS 41 | [#howtouse] 42 | -- 43 | 44 | [float] 45 | === Example Code 46 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 47 | 48 | 49 | [source,arduino] 50 | ---- 51 | void setup() { 52 | //start keyboard communication 53 | Keyboard.begin(); 54 | //send a keystroke 55 | Keyboard.print("Hello!"); 56 | //end keyboard communication 57 | Keyboard.end(); 58 | } 59 | 60 | void loop() { 61 | //do nothing 62 | } 63 | ---- 64 | [%hardbreaks] 65 | 66 | 67 | 68 | [float] 69 | === See also 70 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 71 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 72 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 73 | 74 | [role="language"] 75 | * #LANGUAGE# link:../keyboardBegin[keyboard.begin]() + 76 | * #LANGUAGE# link:../keyboardPress[keyboard.press]() + 77 | * #LANGUAGE# link:../keyboardPrint[keyboard.print]() + 78 | * #LANGUAGE# link:../keyboardPrintln[keyboard.println]() + 79 | * #LANGUAGE# link:../keyboardRelease[keyboard.release]() + 80 | * #LANGUAGE# link:../keyboardReleaseAll[keyboard.releaseAll]() + 81 | * #LANGUAGE# link:../keyboardWrite[keyboard.write]() 82 | -- 83 | // HOW TO USE SECTION ENDS 84 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Stream/streamReadBytesUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Stream.readBytesUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = readBytesUntil() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `readBytesUntil()` reads characters from a stream into a buffer. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see link:../streamSetTimeout[setTimeout()]). 18 | 19 | `readBytesUntil()` returns the number of bytes placed in the buffer. A 0 means no valid data was found. 20 | 21 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | `stream.readBytesUntil(character, buffer, length)` 28 | 29 | 30 | [float] 31 | === Parameters 32 | `stream` : an instance of a class that inherits from Stream. 33 | 34 | `character` : the character to search for (`char`) 35 | 36 | `buffer`: the buffer to store the bytes in (`char[]` or `byte[]`) 37 | 38 | `length : the number of bytes to `read(int)` 39 | 40 | [float] 41 | === Returns 42 | The number of bytes placed in the buffer. 43 | 44 | -- 45 | // OVERVIEW SECTION ENDS 46 | 47 | 48 | 49 | 50 | // HOW TO USE SECTION STARTS 51 | [#howtouse] 52 | -- 53 | 54 | [float] 55 | === Example Code 56 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 57 | 58 | [float] 59 | === See also 60 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 61 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 62 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 63 | [role="language"] 64 | * #LANGUAGE# link:../../stream[stream] 65 | -- 66 | // HOW TO USE SECTION ENDS 67 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/readStringUntil.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.readStringUntil() 3 | --- 4 | 5 | 6 | 7 | 8 | = readStringUntil() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | `readStringUntil()` reads characters from the serial buffer into a string. The function terminates if it times out (see link:../setTimeout[setTimeout()]). 18 | 19 | This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). See the link:../../stream[Stream class] main page for more information. 20 | 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `Serial.readString(terminator)` 27 | 28 | 29 | [float] 30 | === Parameters 31 | `terminator` : the character to search for (`char`) 32 | 33 | [float] 34 | === Returns 35 | The entire string read from the serial buffer, until the terminator character is detected 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === See also 49 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 50 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 51 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 52 | [role="language"] 53 | * #LANGUAGE# link:../../serial[Serial] + 54 | * #LANGUAGE# link:../begin[begin()] + 55 | * #LANGUAGE# link:../end[end()] + 56 | * #LANGUAGE# link:../available[available()] + 57 | * #LANGUAGE# link:../read[read()] + 58 | * #LANGUAGE# link:../peek[peek()] + 59 | * #LANGUAGE# link:../flush[flush()] + 60 | * #LANGUAGE# link:../print[print()] + 61 | * #LANGUAGE# link:../println[println()] + 62 | * #LANGUAGE# link:../write[write()] + 63 | * #LANGUAGE# link:../serialEvent[SerialEvent()] + 64 | * #LANGUAGE# link:../../stream/streamParseFloat[stream.parseFloat()] 65 | 66 | -- 67 | // HOW TO USE SECTION ENDS 68 | -------------------------------------------------------------------------------- /Language/Structure/Control Structure/goto.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: goto 3 | categories: [ "Structure" ] 4 | subCategories: [ "Control Structure" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = goto 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Transfers program flow to a labeled point in the program 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | [source,arduino] 27 | ---- 28 | label: 29 | 30 | goto label; // sends program flow to the label 31 | ---- 32 | 33 | -- 34 | // OVERVIEW SECTION ENDS 35 | 36 | 37 | 38 | 39 | // HOW TO USE SECTION STARTS 40 | [#howtouse] 41 | -- 42 | 43 | [float] 44 | === Example Code 45 | 46 | [source,arduino] 47 | ---- 48 | for(byte r = 0; r < 255; r++){ 49 | for(byte g = 255; g > -1; g--){ 50 | for(byte b = 0; b < 255; b++){ 51 | if (analogRead(0) > 250){ goto bailout;} 52 | // more statements ... 53 | } 54 | } 55 | } 56 | 57 | bailout: 58 | ---- 59 | [%hardbreaks] 60 | 61 | [float] 62 | === Notes and Warnings 63 | The use of `goto` is discouraged in C programming, and some authors of C programming books claim that the `goto` statement is never necessary, but used judiciously, it can simplify certain programs. The reason that many programmers frown upon the use of goto is that with the unrestrained use of `goto` statements, it is easy to create a program with undefined program flow, which can never be debugged. 64 | 65 | With that said, there are instances where a `goto` statement can come in handy, and simplify coding. One of these situations is to break out of deeply nested link:../for[for] loops, or link:../if[if] logic blocks, on a certain condition. 66 | [%hardbreaks] 67 | 68 | [float] 69 | === See also 70 | [role="language"] 71 | * #LANGUAGE# link:../continue[continue] 72 | * #LANGUAGE# link:../break[break] 73 | 74 | -- 75 | // HOW TO USE SECTION ENDS 76 | -------------------------------------------------------------------------------- /Language/Functions/USB/Mouse.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Mouse 3 | categories: [ "Functions" ] 4 | subCategories: [ "USB" ] 5 | 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = Mouse 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | The mouse functions enable a Leonardo, Micro, or Due to control cursor movement on a connected computer. When updating the cursor position, it is always relative to the cursor's previous location. 22 | [%hardbreaks] 23 | -- 24 | // OVERVIEW SECTION ENDS 25 | 26 | 27 | [float] 28 | === Notes and Warnings 29 | These core libraries allow a 32u4 based boards or Due and Zero board to appear as a native Mouse and/or Keyboard to a connected computer. 30 | [%hardbreaks] 31 | *A word of caution on using the Mouse and Keyboard libraries*: if the Mouse or Keyboard library is constantly running, it will be difficult to program your board. Functions such as `Mouse.move()` and `Keyboard.print()` will move your cursor or send keystrokes to a connected computer and should only be called when you are ready to handle them. It is recommended to use a control system to turn this functionality on, like a physical switch or only responding to specific input you can control. 32 | [%hardbreaks] 33 | When using the Mouse or Keyboard library, it may be best to test your output first using `Serial.print()`. This way, you can be sure you know what values are being reported. Refer to the Mouse and Keyboard examples for some ways to handle this. 34 | [%hardbreaks] 35 | // FUNCTIONS SECTION STARTS 36 | [#functions] 37 | -- 38 | 39 | ''' 40 | 41 | [float] 42 | === Functions 43 | link:../mouse/mousebegin[Mouse.begin()] + 44 | link:../mouse/mouseclick[Mouse.click()] + 45 | link:../mouse/mouseend[Mouse.end()] + 46 | link:../mouse/mousemove[Mouse.move()] + 47 | link:../mouse/mousepress[Mouse.press()] + 48 | link:../mouse/mouserelease[Mouse.release()] + 49 | link:../mouse/mouseispressed[Mouse.isPressed()] 50 | 51 | ''' 52 | 53 | -- 54 | // FUNCTIONS SECTION ENDS 55 | -------------------------------------------------------------------------------- /Language/Structure/Bitwise Operators/bitwiseOr.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "|" 3 | title_expanded: bitwise or 4 | categories: [ "Structure" ] 5 | subCategories: [ "Bitwise Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = | Bitwise OR 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | The bitwise OR operator in C++ is the vertical bar symbol, |. Like the & operator, | operates independently each bit in its two surrounding integer expressions, but what it does is different (of course). The bitwise OR of two bits is 1 if either or both of the input bits is 1, otherwise it is 0. 22 | [%hardbreaks] 23 | 24 | In other words: 25 | 26 | 0 0 1 1 operand1 27 | 0 1 0 1 operand2 28 | ---------- 29 | 0 1 1 1 (operand1 | operand2) - returned result 30 | [%hardbreaks] 31 | 32 | -- 33 | // OVERVIEW SECTION ENDS 34 | 35 | 36 | 37 | // HOW TO USE SECTION STARTS 38 | [#howtouse] 39 | -- 40 | 41 | [float] 42 | === Example Code 43 | 44 | [source,arduino] 45 | ---- 46 | int a = 92; // in binary: 0000000001011100 47 | int b = 101; // in binary: 0000000001100101 48 | int c = a | b; // result: 0000000001111101, or 125 in decimal. 49 | ---- 50 | [%hardbreaks] 51 | 52 | One of the most common uses of the Bitwise OR is to set multiple bits in a bit-packed number. 53 | 54 | [source,arduino] 55 | ---- 56 | DDRD = DDRD | B11111100; // set direction bits for pins 2 to 7, leave 0 and 1 untouched (xx | 00 == xx) 57 | // same as pinMode(pin, OUTPUT) for pins 2 to 7 58 | ---- 59 | 60 | [float] 61 | === See also 62 | 63 | [role="language"] 64 | * #LANGUAGE# link:../bitwiseAnd[& Bitwise AND] 65 | * #LANGUAGE# link:../bitwiseNot[~ Bitwise NOT] 66 | * #LANGUAGE# link:../../boolean-operators/logicalOr[|| Logical OR] 67 | 68 | [role="example"] 69 | * #EXAMPLE# http://www.arduino.cc/playground/Code/BitMath[BitMath Tutorial^] 70 | 71 | -- 72 | // HOW TO USE SECTION ENDS 73 | -------------------------------------------------------------------------------- /Language/Variables/Data Types/unsignedLong.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: unsigned long 3 | categories: [ "Variables" ] 4 | subCategories: [ "Data Types" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = unsigned long 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1). 21 | [%hardbreaks] 22 | 23 | [float] 24 | === Syntax 25 | 26 | `unsigned long var = val;` 27 | 28 | `var` - your long variable name 29 | `val` - the value you assign to that variable 30 | [%hardbreaks] 31 | 32 | -- 33 | // OVERVIEW SECTION ENDS 34 | 35 | 36 | 37 | 38 | // HOW TO USE SECTION STARTS 39 | [#howtouse] 40 | -- 41 | 42 | [float] 43 | === Example Code 44 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 45 | 46 | 47 | [source,arduino] 48 | ---- 49 | unsigned long time; 50 | 51 | void setup() 52 | { 53 | Serial.begin(9600); 54 | } 55 | 56 | void loop() 57 | { 58 | Serial.print("Time: "); 59 | time = millis(); 60 | //prints time since program started 61 | Serial.println(time); 62 | // wait a second so as not to send massive amounts of data 63 | delay(1000); 64 | } 65 | ---- 66 | [%hardbreaks] 67 | 68 | [float] 69 | === See also 70 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 71 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 72 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 73 | 74 | * #DEFINITION# link:../byte[byte] + 75 | * #DEFINITION# link:../int[int] + 76 | * #DEFINITION# link:../unsignedInt[unsigned int] + 77 | * #DEFINITION# link:../long[long] + 78 | * #DEFINITION# link:../../constants/integerConstants[Integer Constants] + 79 | 80 | 81 | -- 82 | // HOW TO USE SECTION ENDS 83 | -------------------------------------------------------------------------------- /Language/Functions/Communication/Serial/serialEvent.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Serial.serialEvent() 3 | --- 4 | 5 | 6 | 7 | 8 | = serialEvent() 9 | 10 | 11 | // OVERVIEW SECTION STARTS 12 | [#overview] 13 | -- 14 | 15 | [float] 16 | === Description 17 | Called when data is available. Use `Serial.read()` to capture this data. 18 | 19 | NB : Currently, `serialEvent()` is not compatible with the Esplora, Leonardo, or Micro 20 | [%hardbreaks] 21 | 22 | 23 | [float] 24 | === Syntax 25 | 26 | [source,arduino] 27 | ---- 28 | void serialEvent(){ 29 | //statements 30 | } 31 | ---- 32 | Arduino Mega only: 33 | [source,arduino] 34 | ---- 35 | void serialEvent1(){ 36 | //statements 37 | } 38 | 39 | void serialEvent2(){ 40 | //statements 41 | } 42 | 43 | void serialEvent3(){ 44 | //statements 45 | } 46 | ---- 47 | 48 | [float] 49 | === Parameters 50 | `statements`: any valid statements 51 | 52 | [float] 53 | === Returns 54 | Nothing 55 | 56 | -- 57 | // OVERVIEW SECTION ENDS 58 | 59 | 60 | 61 | 62 | // HOW TO USE SECTION STARTS 63 | [#howtouse] 64 | -- 65 | 66 | [float] 67 | === Notes and Warnings 68 | [%hardbreaks] 69 | 70 | [float] 71 | === See also 72 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 73 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 74 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 75 | [role="example"] 76 | * #EXAMPLE# http://arduino.cc/en/Tutorial/SerialEvent[SerialEvent Tutorial] 77 | 78 | [role="language"] 79 | * #LANGUAGE# link:../begin[begin()] + 80 | * #LANGUAGE# link:../end[end()] + 81 | * #LANGUAGE# link:../available[available()] + 82 | * #LANGUAGE# link:../read[read()] + 83 | * #LANGUAGE# link:../peek[peek()] + 84 | * #LANGUAGE# link:../flush[flush()] + 85 | * #LANGUAGE# link:../print[print()] + 86 | * #LANGUAGE# link:../println[println()] + 87 | * #LANGUAGE# link:../write[write()] + 88 | * #LANGUAGE# link:../serialEvent[SerialEvent()] 89 | 90 | 91 | -- 92 | // HOW TO USE SECTION ENDS -------------------------------------------------------------------------------- /Language/Structure/Arithmetic Operators/modulo.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: "%" 3 | title_expanded: "modulo" 4 | categories: [ "Structure" ] 5 | subCategories: [ "Arithmetic Operators" ] 6 | --- 7 | 8 | 9 | 10 | 11 | 12 | = % Modulo 13 | 14 | 15 | // OVERVIEW SECTION STARTS 16 | [#overview] 17 | -- 18 | 19 | [float] 20 | === Description 21 | *Modulo* operation calculates the remainder when one integer is divided by another. It is useful for keeping a variable within a particular range (e.g. the size of an array). The `%` (percent) symbol is used to carry out modulo operation. 22 | [%hardbreaks] 23 | 24 | 25 | [float] 26 | === Syntax 27 | [source,arduino] 28 | ---- 29 | remainder = dividend % divisor; 30 | ---- 31 | 32 | [float] 33 | === Parameters 34 | `remainder` : variable. *Allowed data types:* int, float, double + 35 | `dividend` : variable or constant. *Allowed data types:* int + 36 | `divisor` : *non zero* variable or constant. *Allowed data types:* int 37 | [%hardbreaks] 38 | 39 | -- 40 | // OVERVIEW SECTION ENDS 41 | 42 | 43 | 44 | // HOW TO USE SECTION STARTS 45 | [#howtouse] 46 | -- 47 | 48 | [float] 49 | === Example Code 50 | 51 | [source,arduino] 52 | ---- 53 | int x = 0; 54 | x = 7 % 5; // x now contains 2 55 | x = 9 % 5; // x now contains 4 56 | x = 5 % 5; // x now contains 0 57 | x = 4 % 5; // x now contains 4 58 | ---- 59 | 60 | [source,arduino] 61 | ---- 62 | /* update one value in an array each time through a loop */ 63 | 64 | int values[10]; 65 | int i = 0; 66 | 67 | void setup() {} 68 | 69 | void loop() 70 | { 71 | values[i] = analogRead(0); 72 | i = (i + 1) % 10; // modulo operator rolls over variable 73 | } 74 | ---- 75 | [%hardbreaks] 76 | 77 | [float] 78 | === Notes and Warnings 79 | The modulo operator does not work on floats. 80 | [%hardbreaks] 81 | 82 | [float] 83 | === See also 84 | 85 | [role="language"] 86 | * #LANGUAGE# link:../division[Division] 87 | -- 88 | // HOW TO USE SECTION ENDS 89 | -------------------------------------------------------------------------------- /Language/Functions/Interrupts/interrupts.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: interrupts() 3 | categories: [ "Functions" ] 4 | subCategories: [ "Interrupts" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = interrupts() 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Re-enables interrupts (after they've been disabled by link:../noInterrupts[noInterrupts()]. Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code. 21 | [%hardbreaks] 22 | 23 | 24 | [float] 25 | === Syntax 26 | `interrupts()` 27 | 28 | 29 | [float] 30 | === Parameters 31 | Nothing 32 | 33 | [float] 34 | === Returns 35 | Nothing 36 | 37 | -- 38 | // OVERVIEW SECTION ENDS 39 | 40 | 41 | 42 | 43 | // HOW TO USE SECTION STARTS 44 | [#howtouse] 45 | -- 46 | 47 | [float] 48 | === Example Code 49 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 50 | The code enables Interrupts. 51 | 52 | [source,arduino] 53 | ---- 54 | void setup() {} 55 | 56 | void loop() 57 | { 58 | noInterrupts(); 59 | // critical, time-sensitive code here 60 | interrupts(); 61 | // other code here 62 | } 63 | ---- 64 | [%hardbreaks] 65 | 66 | 67 | [float] 68 | === See also 69 | // Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#), 70 | // definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials 71 | // (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 72 | [role="language"] 73 | * #LANGUAGE# link:../noInterrupts[noInterrupts()] + 74 | * #LANGUAGE# link:../../external-interrupts/attachInterrupt[attachInterrupts()] + 75 | * #LANGUAGE# link:../../external-interrupts/detachInterrupt[detachInterrupts()] 76 | 77 | -- 78 | // HOW TO USE SECTION ENDS 79 | -------------------------------------------------------------------------------- /Language/Variables/Variable Scope & Qualifiers/scope.adoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: scope 3 | categories: [ "Variables" ] 4 | subCategories: [ "Variable Scope & Qualifiers" ] 5 | --- 6 | 7 | 8 | 9 | 10 | 11 | = Variable Scope 12 | 13 | 14 | // OVERVIEW SECTION STARTS 15 | [#overview] 16 | -- 17 | 18 | [float] 19 | === Description 20 | Variables in the C programming language, which Arduino uses, have a property called scope. This is in contrast to early versions of languages such as BASIC where every variable is a _global_ variable. 21 | 22 | A global variable is one that can be seen by every function in a program. Local variables are only visible to the function in which they are declared. In the Arduino environment, any variable declared outside of a function (e.g. setup(), loop(), etc. ), is a _global_ variable. 23 | 24 | When programs start to get larger and more complex, local variables are a useful way to insure that only one function has access to its own variables. This prevents programming errors when one function inadvertently modifies variables used by another function. 25 | 26 | It is also sometimes handy to declare and initialize a variable inside a `for` loop. This creates a variable that can only be accessed from inside the for-loop brackets. 27 | [%hardbreaks] 28 | 29 | -- 30 | // OVERVIEW SECTION ENDS 31 | 32 | 33 | 34 | 35 | // HOW TO USE SECTION STARTS 36 | [#howtouse] 37 | -- 38 | 39 | [float] 40 | === Example Code 41 | // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ 42 | 43 | 44 | [source,arduino] 45 | ---- 46 | int gPWMval; // any function will see this variable 47 | 48 | void setup() 49 | { 50 | // ... 51 | } 52 | 53 | void loop() 54 | { 55 | int i; // "i" is only "visible" inside of "loop" 56 | float f; // "f" is only "visible" inside of "loop" 57 | // ... 58 | 59 | for (int j = 0; j <100; j++){ 60 | // variable j can only be accessed inside the for-loop brackets 61 | } 62 | 63 | } 64 | ---- 65 | [%hardbreaks] 66 | 67 | 68 | -- 69 | // HOW TO USE SECTION ENDS 70 | --------------------------------------------------------------------------------