Skip to content

Commit c8d7e78

Browse files
committed
Merge pull request #12 from arduino/Language_content
Update min(), max(), abs(), ADD stream.adoc
2 parents f109a69 + 3d8b62e commit c8d7e78

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
:source-highlighter: pygments
2+
:pygments-style: arduino
3+
:ext-relative: adoc
4+
5+
= Stream
6+
7+
8+
// OVERVIEW SECTION STARTS
9+
[#overview]
10+
--
11+
12+
[float]
13+
=== Description
14+
Stream is the base class for character and binary based streams. It is not called directly, but invoked whenever you use a function that relies on it.
15+
16+
Stream defines the reading functions in Arduino. When using any core functionality that uses a `read()` or similar method, you can safely assume it calls on the Stream class. For functions like `print()`, Stream inherits from the Print class.
17+
18+
Some of the libraries that rely on Stream include :
19+
20+
* link:serial{ext-relative}[Serial] +
21+
* link:{ext-relative}[Wire] +
22+
* link:{ext-relative}[Ethernet Client] +
23+
* link:{ext-relative}[Ethernet Server] +
24+
* link:{ext-relative}[SD]
25+
26+
27+
--
28+
// OVERVIEW SECTION ENDS
29+
30+
31+
// FUNCTIONS SECTION STARTS
32+
[#functions]
33+
--
34+
35+
'''
36+
37+
[float]
38+
=== Functions
39+
link:/Stream/streamAvailable{ext-relative}[available()] +
40+
link:/Stream/streamRead{ext-relative}[read()] +
41+
link:/Stream/streamFlush{ext-relative}[flush()] +
42+
link:/Stream/streamFind{ext-relative}[find()] +
43+
link:/Stream/streamFindUntil{ext-relative}[findUntil()] +
44+
link:/Stream/streamPeek{ext-relative}[peek()] +
45+
link:/Stream/streamReadBytes{ext-relative}[readBytes()] +
46+
link:/Stream/streamReadBytesUntil{ext-relative}[readBytesUntil()] +
47+
link:/Stream/streamReadString{ext-relative}[readString()] +
48+
link:/Stream/streamReadStringUntil{ext-relative}[readStringUntil()] +
49+
link:/Stream/streamParseInt{ext-relative}[parseInt()] +
50+
link:/Stream/streamParseFloat{ext-relative}[parseFloat()] +
51+
link:/Stream/streamSetTimeout{ext-relative}[setTimeout()]
52+
53+
'''
54+
55+
--
56+
// FUNCTIONS SECTION ENDS

Language/Functions/Math/abs.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Because of the way the abs() function is implemented, avoid using other function
4848
----
4949
abs(a++); // avoid this - yields incorrect results
5050
51-
a++; // use this instead -
52-
abs(a); // keep other math outside the function
51+
abs(a); // use this instead -
52+
a++; // keep other math outside the function
5353
----
5454
[%hardbreaks]
5555

Language/Functions/Math/max.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Because of the way the `max()` function is implemented, avoid using other functi
6161
----
6262
max(a--, 0); // avoid this - yields incorrect results
6363
64-
a--; // use this instead -
65-
max(a, 0); // keep other math outside the function
64+
max(a, 0); // use this instead -
65+
a--; // keep other math outside the function
6666
----
6767
[%hardbreaks]
6868

Language/Functions/Math/min.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Because of the way the `min()` function is implemented, avoid using other functi
6262
----
6363
min(a++, 100); // avoid this - yields incorrect results
6464
65-
a++;
66-
min(a, 100); // use this instead - keep other math outside the function
65+
min(a, 100);
66+
a++; // use this instead - keep other math outside the function
6767
----
6868
[%hardbreaks]
6969

0 commit comments

Comments
 (0)