Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cedaeb7

Browse files
committedFeb 16, 2015
Merge pull request #1 from arduino/terms-updates
Terms updates
2 parents aa09885 + 358d47c commit cedaeb7

File tree

8 files changed

+88
-40
lines changed

8 files changed

+88
-40
lines changed
 

‎Language/Functions/Analog IO/analogWrite.adoc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
5+
16
= analogWrite()
27

38

@@ -9,8 +14,10 @@
914
=== Description
1015
Writes an analog value (http://arduino.cc/en/Tutorial/PWM[PWM wave]) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to `analogWrite()`, the pin will generate a steady square wave of the specified duty cycle until the next call to `analogWrite()` (or a call to `digitalRead()` or `digitalWrite()` on the same pin). The frequency of the PWM signal on most pins is approximately 490 Hz. On the Uno and similar boards, pins 5 and 6 have a frequency of approximately 980 Hz.
1116
[%hardbreaks]
12-
13-
image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="", title="A beautiful Arduino UNO"]
17+
On most Arduino boards (those with the ATmega168 or ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11. On the Arduino Mega, it works on pins 2 - 13 and 44 - 46. Older Arduino boards with an ATmega8 only support `analogWrite()` on pins 9, 10, and 11.
18+
The Arduino DUE supports `analogWrite()` on pins 2 through 13, plus pins DAC0 and DAC1. Unlike the PWM pins, DAC0 and DAC1 are Digital to Analog converters, and act as true analog outputs.
19+
You do not need to call `pinMode()` to set the pin as an output before calling `analogWrite()`.
20+
The `analogWrite` function has nothing to do with the analog pins or the `analogRead` function.
1421
[%hardbreaks]
1522

1623

@@ -21,8 +28,8 @@ image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="
2128

2229
[float]
2330
=== Parameters
24-
`pin`: the pin to write to. +
25-
`value`: the duty cycle: between 0 (always off) and 255 (always on).
31+
`pin`: the pin to write to. Allowed data types: int. +
32+
`value`: the duty cycle: between 0 (always off) and 255 (always on). Allowed data types: int
2633

2734

2835
[float]
@@ -40,7 +47,7 @@ Nothing
4047
--
4148

4249
[float]
43-
=== Example
50+
=== Example Code
4451
Sets the output to the LED proportional to the value read from the potentiometer.
4552

4653

@@ -66,23 +73,21 @@ void loop()
6673

6774
[float]
6875
=== Notes and Warnings
69-
This is because of interactions with the `millis()` and `delay()` functions
70-
[%hardbreaks]
71-
image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="", title="A beautiful Arduino UNO"]
76+
The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the `millis()` and `delay()` functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g. 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6.
7277
[%hardbreaks]
7378

7479

7580
[float]
7681
=== See also
7782
[role="language"]
78-
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
79-
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
83+
* #LANGUAGE# link:analogRead{ext-relative}[analogRead()]
84+
* #LANGUAGE# link:analogWriteResolution{ext-relative}[analogWriteResolution()]
8085

8186
[role="definition"]
82-
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM]
87+
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM^]
8388

8489
[role="example"]
85-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink]
90+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink^]
8691

8792
--
8893
// HOW TO USE SECTION ENDS

‎Language/Functions/Communication/serial.adoc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
15
= Serial()
26

37

@@ -59,15 +63,16 @@ http://arduino.cc[serialEvent()]
5963

6064
[float]
6165
=== See also
62-
[role="language"]
63-
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
64-
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
65-
66-
[role="definition"]
67-
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM]
6866

6967
[role="example"]
70-
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink]
68+
* #EXAMPLE# http://arduino.cc/en/Tutorial/ReadAsciiString[ReadAsciiString^]
69+
* #EXAMPLE# http://arduino.cc/en/Tutorial/ASCIITable[ASCII TAble^]
70+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Dimmer[Dimmer^]
71+
* #EXAMPLE# http://arduino.cc/en/Tutorial/Graph[Graph^]
72+
* #EXAMPLE# http://arduino.cc/en/Tutorial/PhysicalPixel[Physical Pixel^]
73+
* #EXAMPLE# http://arduino.cc/en/Tutorial/SerialCallResponse[Serial Call Response^]
74+
* #EXAMPLE# http://arduino.cc/en/Tutorial/SerialCallResponseASCII[Serial Call Response ASCII^]
75+
7176

7277
--
7378
// SEEALSO SECTION ENDS
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
15
= && (and)
26

37

@@ -8,16 +12,11 @@
812
[float]
913
=== Description
1014
Boolean Operators can be used inside the condition of an `if` statement. +
11-
&& is true only if both operands are true, for instance in this example:
12-
13-
[source,arduino]
14-
----
15-
if (digitalRead(2) == HIGH && digitalRead(3) == HIGH) { // read two switches
16-
// ...
17-
}
15+
`&&` is true only if both operands are true, for instance in this example: +
1816

17+
`if (digitalRead(2) == HIGH && digitalRead(3) == HIGH)`
18+
[%hardbreaks]
1919
is true only if both inputs are high.
20-
----
2120
[%hardbreaks]
2221

2322
--
@@ -31,7 +30,7 @@ is true only if both inputs are high.
3130
--
3231

3332
[float]
34-
=== Example
33+
=== Example Code
3534

3635

3736
[source,arduino]
@@ -43,16 +42,16 @@ if (a >= 10 && a <= 20){} // true if a is between 10 and 20
4342

4443
[float]
4544
=== Notes and Warnings
46-
Make sure you don't mistake the boolean AND operator, && (double ampersand) for the bitwise AND operator & (single ampersand). They are entirely different beasts.
45+
Make sure you don't mistake the boolean AND operator, `&&` (double ampersand) for the bitwise AND operator `&` (single ampersand). They are entirely different beasts.
4746

4847

4948
[float]
5049
=== See also
5150
[role="language"]
52-
* #LANGUAGE# http://arduino.cc/en/Reference/BitwiseAnd[&] (bitwise AND)
53-
* #LANGUAGE# http://arduino.cc/en/Reference/BitwiseAnd[|] (bitwise OR)
54-
* #LANGUAGE# http://arduino.cc/en/Reference/BitwiseXorNot[~] (bitwise NOT)
55-
* #LANGUAGE# http://arduino.cc/en/Reference/If[if]
51+
* #LANGUAGE# link:BitwiseAnd{ext-relative}[&^] (bitwise AND)
52+
* #LANGUAGE# link:BitwiseOr{ext-relative}[|^] (bitwise OR)
53+
* #LANGUAGE# link:BitwiseXorNot{ext-relative}[~^] (bitwise NOT)
54+
* #LANGUAGE# link:If{ext-relative}[if^]
5655

5756
--
5857
// HOW TO USE SECTION ENDS

‎Language/Structure/Further Syntax/CurlyBraces.adoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
15
= {} Curly Braces
26

37

@@ -26,7 +30,7 @@ Unbalanced braces can often lead to cryptic, impenetrable compiler errors that c
2630
--
2731

2832
[float]
29-
=== Example
33+
=== Example Code
3034
The main uses of curly braces are listed in the examples below.
3135

3236

@@ -73,7 +77,7 @@ for (initialisation; termination condition; incrementing expr)
7377

7478

7579
[float]
76-
==== Functions
80+
==== Conditional Statements
7781

7882

7983
[source,arduino]
@@ -95,5 +99,13 @@ else
9599
[%hardbreaks]
96100

97101

102+
[float]
103+
=== See also
104+
[role="language"]
105+
* #LANGUAGE# link:SemiColon{ext-relative}[;^] (semicolon)
106+
* #LANGUAGE# link:SingleComment{ext-relative}[//^] (single line comment)
107+
* #LANGUAGE# link:MultiComments{ext-relative}[/* */^] (multi-line comment)
108+
109+
98110
--
99111
// HOW TO USE SECTION ENDS

‎Language/Structure/Main/setup.adoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
15
= setup()
26

37

@@ -29,7 +33,7 @@ Nothing
2933
--
3034

3135
[float]
32-
=== Example
36+
=== Example Code
3337

3438
[source,arduino]
3539
----
@@ -50,3 +54,8 @@ void loop()
5054

5155
--
5256
// HOW TO USE SECTION ENDS
57+
58+
[float]
59+
=== See also
60+
[role="language"]
61+
* #LANGUAGE# link:Loop{ext-relative}[loop^]

‎Language/Variables/Constants/high-low.adoc

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎Language/Variables/Utilities/sizeof.adoc

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,25 @@ If you want to contribute to the Language Reference or edit existing content, yo
1616
Please note that every Reference file should include as least a Description, some Example Code, and links to other relevant infos (See Also section).
1717

1818
If you need to add images to the Asciidoc please create a folder called attachments in the same directory as the Asciidoc file. Images can be saved in SVG and PNG format, max size 200KB.
19+
20+
##Folder Structure
21+
```
22+
reference-en
23+
├─ AsciiDoc_sample
24+
│   ├── AsciiDoc_Dictionary
25+
│   │   ├── AsciiDoc_Template-Dictionary.adoc
26+
│   │   └── attachments
27+
│   └── Reference_Terms
28+
│   ├── AsciiDoc_Template-Parent_Of_Entities.adoc
29+
│     ├── AsciiDoc_Template-Single_Entity.adoc
30+
│     └── attachments
31+
├── Language
32+
│   ├── Functions
33+
│   ├── Structure
34+
│   └── Variables
35+
├── LICENCE.md
36+
└── README.md
37+
38+
```
39+
40+
Within the Language folder, the file tree follows the same structure as in the [Arduino Reference webpage](http://arduino.cc/en/Reference/HomePage).

0 commit comments

Comments
 (0)
Please sign in to comment.