Skip to content

Terms updates #1

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 2 commits into from
Feb 16, 2015
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
29 changes: 17 additions & 12 deletions Language/Functions/Analog IO/analogWrite.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:source-highlighter: pygments
:pygments-style: arduino
:ext-relative: adoc


= analogWrite()


Expand All @@ -9,8 +14,10 @@
=== Description
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.
[%hardbreaks]

image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="", title="A beautiful Arduino UNO"]
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.
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.
You do not need to call `pinMode()` to set the pin as an output before calling `analogWrite()`.
The `analogWrite` function has nothing to do with the analog pins or the `analogRead` function.
[%hardbreaks]


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

[float]
=== Parameters
`pin`: the pin to write to. +
`value`: the duty cycle: between 0 (always off) and 255 (always on).
`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 All @@ -40,7 +47,7 @@ Nothing
--

[float]
=== Example
=== Example Code
Sets the output to the LED proportional to the value read from the potentiometer.


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

[float]
=== Notes and Warnings
This is because of interactions with the `millis()` and `delay()` functions
[%hardbreaks]
image::http://arduino.cc/en/uploads/Main/ArduinoUno_R3_Front_450px.jpg[caption="", title="A beautiful Arduino UNO"]
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.
[%hardbreaks]


[float]
=== See also
[role="language"]
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
* #LANGUAGE# link:analogRead{ext-relative}[analogRead()]
* #LANGUAGE# link:analogWriteResolution{ext-relative}[analogWriteResolution()]

[role="definition"]
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM]
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM^]

[role="example"]
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink]
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink^]

--
// HOW TO USE SECTION ENDS
19 changes: 12 additions & 7 deletions Language/Functions/Communication/serial.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:source-highlighter: pygments
:pygments-style: arduino
:ext-relative: adoc

= Serial()


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

[float]
=== See also
[role="language"]
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]
* #LANGUAGE# http://arduino.cc/en/Reference/AnalogRead[analogRead()]

[role="definition"]
* #DEFINITION# http://arduino.cc/en/Tutorial/PWM[PWM]

[role="example"]
* #EXAMPLE# http://arduino.cc/en/Tutorial/Blink[Blink]
* #EXAMPLE# http://arduino.cc/en/Tutorial/ReadAsciiString[ReadAsciiString^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/ASCIITable[ASCII TAble^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/Dimmer[Dimmer^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/Graph[Graph^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/PhysicalPixel[Physical Pixel^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/SerialCallResponse[Serial Call Response^]
* #EXAMPLE# http://arduino.cc/en/Tutorial/SerialCallResponseASCII[Serial Call Response ASCII^]


--
// SEEALSO SECTION ENDS
27 changes: 13 additions & 14 deletions Language/Structure/Boolean Operators/&&.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:source-highlighter: pygments
:pygments-style: arduino
:ext-relative: adoc

= && (and)


Expand All @@ -8,16 +12,11 @@
[float]
=== Description
Boolean Operators can be used inside the condition of an `if` statement. +
&& is true only if both operands are true, for instance in this example:

[source,arduino]
----
if (digitalRead(2) == HIGH && digitalRead(3) == HIGH) { // read two switches
// ...
}
`&&` is true only if both operands are true, for instance in this example: +

`if (digitalRead(2) == HIGH && digitalRead(3) == HIGH)`
[%hardbreaks]
is true only if both inputs are high.
----
[%hardbreaks]

--
Expand All @@ -31,7 +30,7 @@ is true only if both inputs are high.
--

[float]
=== Example
=== Example Code


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

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


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

--
// HOW TO USE SECTION ENDS
16 changes: 14 additions & 2 deletions Language/Structure/Further Syntax/CurlyBraces.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:source-highlighter: pygments
:pygments-style: arduino
:ext-relative: adoc

= {} Curly Braces


Expand Down Expand Up @@ -26,7 +30,7 @@ Unbalanced braces can often lead to cryptic, impenetrable compiler errors that c
--

[float]
=== Example
=== Example Code
The main uses of curly braces are listed in the examples below.


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


[float]
==== Functions
==== Conditional Statements


[source,arduino]
Expand All @@ -95,5 +99,13 @@ else
[%hardbreaks]


[float]
=== See also
[role="language"]
* #LANGUAGE# link:SemiColon{ext-relative}[;^] (semicolon)
* #LANGUAGE# link:SingleComment{ext-relative}[//^] (single line comment)
* #LANGUAGE# link:MultiComments{ext-relative}[/* */^] (multi-line comment)


--
// HOW TO USE SECTION ENDS
11 changes: 10 additions & 1 deletion Language/Structure/Main/setup.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:source-highlighter: pygments
:pygments-style: arduino
:ext-relative: adoc

= setup()


Expand Down Expand Up @@ -29,7 +33,7 @@ Nothing
--

[float]
=== Example
=== Example Code

[source,arduino]
----
Expand All @@ -50,3 +54,8 @@ void loop()

--
// HOW TO USE SECTION ENDS

[float]
=== See also
[role="language"]
* #LANGUAGE# link:Loop{ext-relative}[loop^]
2 changes: 0 additions & 2 deletions Language/Variables/Constants/high-low.adoc

This file was deleted.

2 changes: 0 additions & 2 deletions Language/Variables/Utilities/sizeof.adoc

This file was deleted.

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

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.

##Folder Structure
```
reference-en
├─ AsciiDoc_sample
│   ├── AsciiDoc_Dictionary
│   │   ├── AsciiDoc_Template-Dictionary.adoc
│   │   └── attachments
│   └── Reference_Terms
│   ├── AsciiDoc_Template-Parent_Of_Entities.adoc
│     ├── AsciiDoc_Template-Single_Entity.adoc
│     └── attachments
├── Language
│   ├── Functions
│   ├── Structure
│   └── Variables
├── LICENCE.md
└── README.md

```

Within the Language folder, the file tree follows the same structure as in the [Arduino Reference webpage](http://arduino.cc/en/Reference/HomePage).