Skip to content

Commit fed91f5

Browse files
authored
Merge branch 'master' into patch-4
2 parents fa9ff44 + 726a250 commit fed91f5

File tree

233 files changed

+7990
-7277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+7990
-7277
lines changed

.drone.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pipeline:
77
- bcmi-labs/reference
88
when:
99
branch: [master]
10-
event: push
10+
event: push

AsciiDoc_sample/AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// This is a documentation file for authors and editors of the Arduino Manutius content platform.
55
// Below you can find a list of all the possible page elements with the corresponding
6-
// AsciiDoc syntax
6+
// AsciiDoc syntax
77

88

99
// GENERAL GUIDELINES
@@ -99,14 +99,14 @@ mailto:[email protected][This is an e-mail link]
9999
This is `code` in a sentence +
100100
`This is a whole line of code` +
101101

102-
// HINT: Please note that sometimes when copy-pasting code a few spaces can be added at the beginnng of each line of code.
102+
// HINT: Please note that sometimes when copy-pasting code a few spaces can be added at the beginnng of each line of code.
103103
// If that happens, please remove the extra spaces. Thanks!
104104

105-
This can be a lot more code
105+
This can be a lot more code
106106
[source,arduino]
107107
----
108-
for (int 1; i<=99; i++) {
109-
Serial.println('We want more code!');
108+
for (int i = 0; i <= 99; i++) {
109+
Serial.println('We want more code!');
110110
}
111111
----
112112
[%hardbreaks]
@@ -115,7 +115,7 @@ for (int 1; i<=99; i++) {
115115

116116
// TABLES
117117
|===
118-
|Name of Column 1 |Name of Column 2 |Name of Column 3
118+
|Name of Column 1 |Name of Column 2 |Name of Column 3
119119

120120
|Cell in column 1, row 1
121121
|Cell in column 2, row 1
@@ -135,7 +135,7 @@ for (int 1; i<=99; i++) {
135135

136136
// IMAGES
137137

138-
// If you need to add an image to the Asciidoc please create a folder called 'attachments' in the same directory as the Asciidoc file,
138+
// If you need to add an image to the Asciidoc please create a folder called 'attachments' in the same directory as the Asciidoc file,
139139
// place the image there and reference it as shown below. Images can be in SVG and PNG format, max size 200KB.
140140

141141
// To include an image on its own line (i.e., a block image), use the image:: prefix in front of the file name and square brackets after it []

AsciiDoc_sample/Reference_Terms/AsciiDoc_Template-Parent_Of_Entities.adoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Parent of Entity Title
3-
categories: [ "Functions" ]
3+
categories: [ "Functions" ]
44
subCategories: [ "Subcategory Name" ]
55
---
66
// ARDUINO LANGUAGE REFERENCE TAG (above) ►►►►► ALWAYS INCLUDE IN YOUR FILE ◄◄◄◄◄
@@ -78,7 +78,7 @@ http://arduino.cc[serialEvent()]
7878

7979
[float]
8080
=== See also
81-
// Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#),
81+
// Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#),
8282
// definitions (please add the tag #DEFINITION#), and examples of Projects and Tutorials
8383
// (please add the tag #EXAMPLE#) ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
8484

@@ -87,6 +87,7 @@ http://arduino.cc[serialEvent()]
8787
// Whenever you want to link to another Reference term, or more in general to a relative link,
8888
// use the syntax shown below. Please note that the file format is subsituted by attribute.
8989
// Please note that you always need to replace spaces that you might find in folder/file names with %20
90+
// The entire link to Reference pages must be lower case, regardless of the case of the folders and files in this repository.
9091
* #LANGUAGE# link:../AsciiDoc_Template-Single_Entity[Single Entity]
9192
* #LANGUAGE# link:../../AsciiDoc_Dictionary/AsciiDoc_Template-Dictionary[AsciiDoc Template Dictionary]
9293

AsciiDoc_sample/Reference_Terms/AsciiDoc_Template-Single_Entity.adoc

+5-7
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ int ledPin = 9; // LED connected to digital pin 9
7676
int analogPin = 3; // potentiometer connected to analog pin 3
7777
int val = 0; // variable to store the read value
7878
79-
void setup()
80-
{
79+
void setup() {
8180
pinMode(ledPin, OUTPUT); // sets the pin as output
8281
}
8382
84-
void loop()
85-
{
83+
void loop() {
8684
val = analogRead(analogPin); // read the input pin
8785
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
8886
}
@@ -108,7 +106,7 @@ image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="
108106

109107
[float]
110108
=== See also
111-
// Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#),
109+
// Link relevant content by category, such as other Reference terms (please add the tag #LANGUAGE#),
112110
// definitions: (please add the tag #DEFINITION#), and examples of Projects and Tutorials
113111
// examples: (please add the tag #EXAMPLE#)
114112

@@ -117,7 +115,8 @@ image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="
117115
// Whenever you want to link to another Reference term, or more in general to a relative link,
118116
// use the syntax shown below. Please note that the file format is subsituted by attribute.
119117
// Please note that you always need to replace spaces that you might find in folder/file names with %20
120-
// for language tag, items will be automatically generated for any other item of the same subcategory,
118+
// The entire link to Reference pages must be lower case, regardless of the case of the folders and files in this repository.
119+
// For language tag, items will be automatically generated for any other item of the same subcategory,
121120
// no need to add links to other pages of the same subcategory
122121
// if you don't include this section, a minimal version with only the other pages of the same subcategory will be generated.
123122
* #LANGUAGE# link:../AsciiDoc_Template-Parent_Of_Entities[Parent Of Entities]
@@ -133,4 +132,3 @@ image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="
133132

134133
--
135134
// SEE ALSO SECTION ENDS
136-

Language/Functions/Advanced IO/noTone.adoc

+12-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Stops the generation of a square wave triggered by `tone()`. Has no effect if no
2727

2828
[float]
2929
=== Parameters
30-
`pin`: the pin on which to stop generating the tone
30+
`pin`: the Arduino pin on which to stop generating the tone
3131

3232
[float]
3333
=== Returns
@@ -50,3 +50,14 @@ If you want to play different pitches on multiple pins, you need to call noTone(
5050

5151
--
5252
// HOW TO USE SECTION ENDS
53+
54+
55+
// SEE ALSO SECTION
56+
[#see_also]
57+
--
58+
59+
[float]
60+
=== See also
61+
62+
--
63+
// SEE ALSO SECTION ENDS

Language/Functions/Advanced IO/pulseIn.adoc

+22-11
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ The timing of this function has been determined empirically and will probably sh
2525

2626
[float]
2727
=== Syntax
28-
`pulseIn(pin, value)`
29-
28+
`pulseIn(pin, value)` +
3029
`pulseIn(pin, value, timeout)`
3130

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

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

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

4343
--
4444
// OVERVIEW SECTION ENDS
@@ -53,24 +53,35 @@ the length of the pulse (in microseconds) or 0 if no pulse started before the ti
5353
[float]
5454
=== Example Code
5555
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
56-
The example calculated the time duration of a pulse on pin 7.
56+
The example prints the time duration of a pulse on pin 7.
5757

5858
[source,arduino]
5959
----
6060
int pin = 7;
6161
unsigned long duration;
6262
63-
void setup()
64-
{
63+
void setup() {
64+
Serial.begin(9600);
6565
pinMode(pin, INPUT);
6666
}
6767
68-
void loop()
69-
{
68+
void loop() {
7069
duration = pulseIn(pin, HIGH);
70+
Serial.println(duration);
7171
}
7272
----
7373
[%hardbreaks]
7474

7575
--
7676
// HOW TO USE SECTION ENDS
77+
78+
79+
// SEE ALSO SECTION
80+
[#see_also]
81+
--
82+
83+
[float]
84+
=== See also
85+
86+
--
87+
// SEE ALSO SECTION ENDS

Language/Functions/Advanced IO/pulseInLong.adoc

+20-7
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ The timing of this function has been determined empirically and will probably sh
2727

2828
[float]
2929
=== Syntax
30-
`pulseInLong(pin, value)`
31-
30+
`pulseInLong(pin, value)` +
3231
`pulseInLong(pin, value, timeout)`
3332

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

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

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

4545
--
4646
// OVERVIEW SECTION ENDS
@@ -55,19 +55,21 @@ the length of the pulse (in microseconds) or 0 if no pulse started before the ti
5555
[float]
5656
=== Example Code
5757
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
58-
The example calculated the time duration of a pulse on pin 7.
58+
The example prints the time duration of a pulse on pin 7.
5959

6060
[source,arduino]
6161
----
6262
int pin = 7;
6363
unsigned long duration;
6464
6565
void setup() {
66+
Serial.begin(9600);
6667
pinMode(pin, INPUT);
6768
}
6869
6970
void loop() {
7071
duration = pulseInLong(pin, HIGH);
72+
Serial.println(duration);
7173
}
7274
----
7375
[%hardbreaks]
@@ -78,3 +80,14 @@ This function relies on micros() so cannot be used in link:../../interrupts/noin
7880

7981
--
8082
// HOW TO USE SECTION ENDS
83+
84+
85+
// SEE ALSO SECTION
86+
[#see_also]
87+
--
88+
89+
[float]
90+
=== See also
91+
92+
--
93+
// SEE ALSO SECTION ENDS

Language/Functions/Advanced IO/shiftIn.adoc

+16-7
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,25 @@ Note: this is a software implementation; Arduino also provides an link:https://w
3232

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

37-
`clockPin`: the pin to toggle to signal a read from *dataPin*
38-
39-
`bitOrder`: which order to shift in the bits; either *MSBFIRST* or *LSBFIRST*.
40-
(Most Significant Bit First, or, Least Significant Bit First)
4139

4240
[float]
4341
=== Returns
44-
the value read (byte)
42+
The value read. Data type: `byte`.
43+
44+
--
45+
// OVERVIEW SECTION ENDS
46+
47+
48+
// SEE ALSO SECTION
49+
[#see_also]
50+
--
51+
52+
[float]
53+
=== See also
4554

4655
--
47-
// OVERVIEW SECTION ENDS
56+
// SEE ALSO SECTION ENDS

Language/Functions/Advanced IO/shiftOut.adoc

+15-7
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ This is a software implementation; see also the https://www.arduino.cc/en/Refere
2828

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

33-
`clockPin`: the pin to toggle once the dataPin has been set to the correct value (int)
34-
35-
`bitOrder`: which order to shift out the bits; either MSBFIRST or LSBFIRST.
36-
(Most Significant Bit First, or, Least Significant Bit First)
37-
38-
`value`: the data to shift out. (byte)
3936

4037
[float]
4138
=== Returns
@@ -121,3 +118,14 @@ shiftOut(dataPin, clock, LSBFIRST, (data >> 8));
121118

122119
--
123120
// HOW TO USE SECTION ENDS
121+
122+
123+
// SEE ALSO SECTION
124+
[#see_also]
125+
--
126+
127+
[float]
128+
=== See also
129+
130+
--
131+
// SEE ALSO SECTION ENDS

Language/Functions/Advanced IO/tone.adoc

+11-13
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,16 @@ It is not possible to generate tones lower than 31Hz. For technical details, see
2929

3030
[float]
3131
=== Syntax
32-
`tone(pin, frequency)`
33-
32+
`tone(pin, frequency)` +
3433
`tone(pin, frequency, duration)`
35-
[%hardbreaks]
34+
3635

3736
[float]
3837
=== Parameters
39-
`pin`: the pin on which to generate the tone
38+
`pin`: the Arduino pin on which to generate the tone. +
39+
`frequency`: the frequency of the tone in hertz. Allowed data types: `unsigned int`. +
40+
`duration`: the duration of the tone in milliseconds (optional). Allowed data types: `unsigned long`.
4041

41-
`frequency`: the frequency of the tone in hertz - `unsigned int`
42-
43-
`duration`: the duration of the tone in milliseconds (optional) - `unsigned long`
44-
[%hardbreaks]
4542

4643
[float]
4744
=== Returns
@@ -77,11 +74,12 @@ If you want to play different pitches on multiple pins, you need to call `noTone
7774
* #LANGUAGE# link:../../analog-io/analogwrite[analogWrite()]
7875

7976
[role="example"]
80-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone[Tone^]
81-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone[Pitch follower^]
82-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone3[Simple Keyboard^]
83-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone4[multiple tones^]
77+
78+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone[Tone Melody^]
79+
* #EXAMPLE# http://arduino.cc/en/Tutorial/tonePitchFollower[Pitch Follower^]
80+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone3[Tone Keyboard^]
81+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Tone4[Tone Multiple^]
8482
* #EXAMPLE# http://arduino.cc/en/Tutorial/PWM[PWM^]
8583

8684
--
87-
// SEE ALSO SECTION ENDS
85+
// SEE ALSO SECTION ENDS

0 commit comments

Comments
 (0)