Skip to content

Commit 9a94497

Browse files
author
SimonePDA
authored
Merge pull request #377 from per1234/attachinterrupt-formatting
Fix formatting of attachInterrupt() page
2 parents 6157811 + 98a662d commit 9a94497

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Language/Functions/External Interrupts/attachInterrupt.adoc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,25 @@ For more information on interrupts, see http://gammon.com.au/interrupts[Nick Gam
6060

6161
[float]
6262
=== Syntax
63-
`attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);` (recommended) +
64-
`attachInterrupt(interrupt, ISR, mode);` (not recommended) +
65-
`attachInterrupt(pin, ISR, mode);` (not recommended Arduino Due, Zero, MKR1000, 101 only)
63+
`attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);` (recommended) +
64+
`attachInterrupt(interrupt, ISR, mode);` (not recommended) +
65+
`attachInterrupt(pin, ISR, mode);` (not recommended Arduino Due, Zero, MKR1000, 101 only)
6666

6767

6868
[float]
6969
=== Parameters
70-
`interrupt`: the number of the interrupt (`int`) +
71-
`pin`: the pin number _(Arduino Due, Zero, MKR1000 only)_ +
72-
`ISR`: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine. +
73-
`mode`: defines when the interrupt should be triggered. Four constants are predefined as valid values: +
70+
`interrupt`: the number of the interrupt (`int`) +
71+
`pin`: the pin number _(Arduino Due, Zero, MKR1000 only)_ +
72+
`ISR`: the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine. +
73+
`mode`: defines when the interrupt should be triggered. Four constants are predefined as valid values: +
7474

7575
* *LOW* to trigger the interrupt whenever the pin is low, +
7676
* *CHANGE* to trigger the interrupt whenever the pin changes value +
7777
* *RISING* to trigger when the pin goes from low to high, +
7878
* *FALLING* for when the pin goes from high to low. +
79-
The Due, Zero and MKR1000 boards allows also: +
79+
80+
The Due, Zero and MKR1000 boards allows also: +
81+
8082
* *HIGH* to trigger the interrupt whenever the pin is high.
8183

8284
[float]
@@ -126,10 +128,10 @@ Note that in the table below, the interrupt numbers refer to the number to be pa
126128

127129
[options="header"]
128130
|===================================================
129-
|Board | int.0 | int.1 | int.2 | int.3 | int.4 | int.5
130-
|Uno, Ethernet | 2 | 3 | | | |
131-
|Mega2560 | 2 | 3 | 21 | 20 | 19 | 18
132-
|32u4 based (e.g Leonardo, Micro) | 3 | 2 | 0 | 1 | 7 |
131+
|Board | int.0 | int.1 | int.2 | int.3 | int.4 | int.5
132+
|Uno, Ethernet | 2 | 3 | | | |
133+
|Mega2560 | 2 | 3 | 21 | 20 | 19 | 18
134+
|32u4 based (e.g Leonardo, Micro) | 3 | 2 | 0 | 1 | 7 |
133135
|===================================================
134136
For Due, Zero, MKR1000 and 101 boards the *interrupt number = pin number*.
135137

0 commit comments

Comments
 (0)