Skip to content

Use standard format for Syntax, Parameters, and Returns sections #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Language/Functions/Advanced IO/pulseIn.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ The timing of this function has been determined empirically and will probably sh

[float]
=== Syntax
`pulseIn(pin, value)`

`pulseIn(pin, value)` +
`pulseIn(pin, value, timeout)`


[float]
=== Parameters
`pin`: the number of the pin on which you want to read the pulse. (int)
`pin`: the number of the pin on which you want to read the pulse. Allowed data types: `int`. +
`value`: type of pulse to read: either link:../../../variables/constants/constants/[HIGH] or link:../../../variables/constants/constants/[LOW]. Allowed data types: `int`. +
`timeout` (optional): the number of microseconds to wait for the pulse to start; default is one second. Allowed data types: `unsigned long`.

`value`: type of pulse to read: either link:../../../variables/constants/constants/[HIGH] or link:../../../variables/constants/constants/[LOW]. (int)

`timeout` (optional): the number of microseconds to wait for the pulse to start; default is one second (unsigned long)
[float]
=== Returns
the length of the pulse (in microseconds) or 0 if no pulse started before the timeout (unsigned long)
The length of the pulse (in microseconds) or 0 if no pulse started before the timeout. Data type: `unsigned long`.

--
// OVERVIEW SECTION ENDS
Expand Down
12 changes: 6 additions & 6 deletions Language/Functions/Advanced IO/pulseInLong.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ The timing of this function has been determined empirically and will probably sh

[float]
=== Syntax
`pulseInLong(pin, value)`

`pulseInLong(pin, value)` +
`pulseInLong(pin, value, timeout)`


[float]
=== Parameters
`pin`: the number of the pin on which you want to read the pulse. (int)
`pin`: the number of the pin on which you want to read the pulse. Allowed data types: `int`. +
`value`: type of pulse to read: either link:../../../variables/constants/constants/[HIGH] or link:../../../variables/constants/constants/[LOW]. Allowed data types: `int`. +
`timeout` (optional): the number of microseconds to wait for the pulse to start; default is one second. Allowed data types: `unsigned long`.

`value`: type of pulse to read: either link:../../../variables/constants/constants/[HIGH] or link:../../../variables/constants/constants/[LOW]. (int)

`timeout` (optional): the number of microseconds to wait for the pulse to start; default is one second (unsigned long)
[float]
=== Returns
the length of the pulse (in microseconds) or 0 if no pulse started before the timeout (unsigned long)
The length of the pulse (in microseconds) or 0 if no pulse started before the timeout. Data type: `unsigned long`.

--
// OVERVIEW SECTION ENDS
Expand Down
10 changes: 4 additions & 6 deletions Language/Functions/Advanced IO/shiftIn.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ Note: this is a software implementation; Arduino also provides an link:https://w

[float]
=== Parameters
`dataPin`: the pin on which to input each bit (int)
`dataPin`: the pin on which to input each bit. Allowed data types: `int`. +
`clockPin`: the pin to toggle to signal a read from *dataPin*. +
`bitOrder`: which order to shift in the bits; either *MSBFIRST* or *LSBFIRST*. (Most Significant Bit First, or, Least Significant Bit First).

`clockPin`: the pin to toggle to signal a read from *dataPin*

`bitOrder`: which order to shift in the bits; either *MSBFIRST* or *LSBFIRST*.
(Most Significant Bit First, or, Least Significant Bit First)

[float]
=== Returns
the value read (byte)
The value read. Data type: `byte`.

--
// OVERVIEW SECTION ENDS
Expand Down
11 changes: 4 additions & 7 deletions Language/Functions/Advanced IO/shiftOut.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ This is a software implementation; see also the https://www.arduino.cc/en/Refere

[float]
=== Parameters
`dataPin`: the pin on which to output each bit (int)
`dataPin`: the pin on which to output each bit. Allowed data types: `int`. +
`clockPin`: the pin to toggle once the dataPin has been set to the correct value. Allowed data types: `int`. +
`bitOrder`: which order to shift out the bits; either MSBFIRST or LSBFIRST. (Most Significant Bit First, or, Least Significant Bit First). +
`value`: the data to shift out. Allowed data types: `byte`.

`clockPin`: the pin to toggle once the dataPin has been set to the correct value (int)

`bitOrder`: which order to shift out the bits; either MSBFIRST or LSBFIRST.
(Most Significant Bit First, or, Least Significant Bit First)

`value`: the data to shift out. (byte)

[float]
=== Returns
Expand Down
13 changes: 5 additions & 8 deletions Language/Functions/Advanced IO/tone.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ It is not possible to generate tones lower than 31Hz. For technical details, see

[float]
=== Syntax
`tone(pin, frequency)`

`tone(pin, frequency)` +
`tone(pin, frequency, duration)`
[%hardbreaks]


[float]
=== Parameters
`pin`: the pin on which to generate the tone
`pin`: the pin on which to generate the tone. +
`frequency`: the frequency of the tone in hertz. Allowed data types: `unsigned int`. +
`duration`: the duration of the tone in milliseconds (optional). Allowed data types: `unsigned long`.

`frequency`: the frequency of the tone in hertz - `unsigned int`

`duration`: the duration of the tone in milliseconds (optional) - `unsigned long`
[%hardbreaks]

[float]
=== Returns
Expand Down
6 changes: 3 additions & 3 deletions Language/Functions/Analog IO/analogRead.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds

[float]
=== Syntax

`analogRead(pin)`


[float]
=== Parameters
`pin`: the name of the analog input pin to read from (A0 to A5 on most boards, A0 to A6 on MKR boards, A0 to A7 on the Mini and Nano, A0 to A15 on the Mega).


[float]
=== Returns

The analog reading on the pin (int). Although it is limited to the resolution of the analog to digital converter (0-1023 for 10 bits or 0-4095 for 12 bits).
The analog reading on the pin. Although it is limited to the resolution of the analog to digital converter (0-1023 for 10 bits or 0-4095 for 12 bits). Data type: `int`.

--
// OVERVIEW SECTION ENDS
Expand Down
1 change: 1 addition & 0 deletions Language/Functions/Analog IO/analogReference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Arduino SAM Boards (Due)
=== Parameters
`type`: which type of reference to use (see list of options in the description).


[float]
=== Returns
Nothing
Expand Down
4 changes: 2 additions & 2 deletions Language/Functions/Analog IO/analogWrite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ The `analogWrite` function has nothing to do with the analog pins or the `analog

[float]
=== Parameters
`pin`: the pin to write to. Allowed data types: int. +
`value`: the duty cycle: between 0 (always off) and 255 (always on). Allowed data types: int
`pin`: the pin to write to. Allowed data types: `int`. +
`value`: the duty cycle: between 0 (always off) and 255 (always on). Allowed data types: `int`.


[float]
Expand Down
1 change: 1 addition & 0 deletions Language/Functions/Bits and Bytes/bit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Computes the value of the specified bit (bit 0 is 1, bit 1 is 2, bit 2 is 4, etc
=== Parameters
`n`: the bit whose value to compute


[float]
=== Returns
The value of the bit.
Expand Down
4 changes: 2 additions & 2 deletions Language/Functions/Bits and Bytes/bitClear.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Clears (writes a 0 to) a bit of a numeric variable.

[float]
=== Parameters
`x`: the numeric variable whose bit to clear
`x`: the numeric variable whose bit to clear. +
`n`: which bit to clear, starting at 0 for the least-significant (rightmost) bit.

`n`: which bit to clear, starting at 0 for the least-significant (rightmost) bit

[float]
=== Returns
Expand Down
7 changes: 3 additions & 4 deletions Language/Functions/Bits and Bytes/bitRead.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ Reads a bit of a number.

[float]
=== Parameters
`x`: the number from which to read

`n`: which bit to read, starting at 0 for the least-significant (rightmost) bit
`x`: the number from which to read. +
`n`: which bit to read, starting at 0 for the least-significant (rightmost) bit.


[float]
=== Returns
the value of the bit (0 or 1).
The value of the bit (0 or 1).

--
// OVERVIEW SECTION ENDS
Expand Down
4 changes: 2 additions & 2 deletions Language/Functions/Bits and Bytes/bitSet.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Sets (writes a 1 to) a bit of a numeric variable.

[float]
=== Parameters
`x`: the numeric variable whose bit to set
`x`: the numeric variable whose bit to set. +
`n`: which bit to set, starting at 0 for the least-significant (rightmost) bit.

`n`: which bit to set, starting at 0 for the least-significant (rightmost) bit

[float]
=== Returns
Expand Down
7 changes: 3 additions & 4 deletions Language/Functions/Bits and Bytes/bitWrite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ Writes a bit of a numeric variable.

[float]
=== Parameters
`x`: the numeric variable to which to write
`x`: the numeric variable to which to write. +
`n`: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit. +
`b`: the value to write to the bit (0 or 1).

`n`: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit

`b`: the value to write to the bit (0 or 1)

[float]
=== Returns
Expand Down
3 changes: 2 additions & 1 deletion Language/Functions/Bits and Bytes/highByte.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ Extracts the high-order (leftmost) byte of a word (or the second lowest byte of
=== Parameters
`x`: a value of any type


[float]
=== Returns
byte
Data type: `byte`.

--
// OVERVIEW SECTION ENDS
Expand Down
4 changes: 3 additions & 1 deletion Language/Functions/Bits and Bytes/lowByte.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ Extracts the low-order (rightmost) byte of a variable (e.g. a word).
=== Parameters
`x`: a value of any type


[float]
=== Returns
byte
Data type: `byte`.

--
// OVERVIEW SECTION ENDS

Expand Down
9 changes: 4 additions & 5 deletions Language/Functions/Characters/isAlpha.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ Analyse if a char is alpha (that is a letter). Returns true if thisChar contains

[float]
=== Syntax
[source,arduino]
----
isAlpha(thisChar)
----
`isAlpha(thisChar)`


[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be improved as:

thisChar: the character variable. Allowed data types: char. ?

What do you think? Too verbose?



[float]
=== Returns
Expand Down
9 changes: 4 additions & 5 deletions Language/Functions/Characters/isAlphaNumeric.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ Analyse if a char is alphanumeric (that is a letter or a numbers). Returns true

[float]
=== Syntax
[source,arduino]
----
isAlphaNumeric(thisChar)
----
`isAlphaNumeric(thisChar)`


[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
9 changes: 4 additions & 5 deletions Language/Functions/Characters/isAscii.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ Analyse if a char is Ascii. Returns true if thisChar contains an Ascii character

[float]
=== Syntax
[source,arduino]
----
isAscii(thisChar)
----
`isAscii(thisChar)`


[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
9 changes: 4 additions & 5 deletions Language/Functions/Characters/isControl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ Analyse if a char is a control character. Returns true if thisChar is a control

[float]
=== Syntax
[source,arduino]
----
isControl(thisChar)
----
`isControl(thisChar)`


[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
9 changes: 4 additions & 5 deletions Language/Functions/Characters/isDigit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ Analyse if a char is a digit (that is a number). Returns true if thisChar is a n

[float]
=== Syntax
[source,arduino]
----
isDigit(thisChar)
----
`isDigit(thisChar)`


[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
8 changes: 3 additions & 5 deletions Language/Functions/Characters/isGraph.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ Analyse if a char is printable with some content (space is printable but has no

[float]
=== Syntax
[source,arduino]
----
isGraph(thisChar)
----
`isGraph(thisChar)`

[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
9 changes: 3 additions & 6 deletions Language/Functions/Characters/isHexadecimalDigit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ Analyse if a char is an hexadecimal digit (A-F, 0-9). Returns true if thisChar c

[float]
=== Syntax
[source,arduino]
----
`isHexadecimalDigit(thisChar)`

isHexadecimalDigit(thisChar)

----

[float]
=== Parameters
`thisChar`: variable. *Allowed data types:* char
`thisChar`: variable. Allowed data types: `char`.


[float]
=== Returns
Expand Down
Loading