diff --git a/Language/Functions/Communication/stream.adoc b/Language/Functions/Communication/stream.adoc new file mode 100644 index 000000000..2564f4673 --- /dev/null +++ b/Language/Functions/Communication/stream.adoc @@ -0,0 +1,56 @@ +:source-highlighter: pygments +:pygments-style: arduino +:ext-relative: adoc + += Stream + + +// OVERVIEW SECTION STARTS +[#overview] +-- + +[float] +=== Description +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. + +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. + +Some of the libraries that rely on Stream include : + +* link:serial{ext-relative}[Serial] + +* link:{ext-relative}[Wire] + +* link:{ext-relative}[Ethernet Client] + +* link:{ext-relative}[Ethernet Server] + +* link:{ext-relative}[SD] + + +-- +// OVERVIEW SECTION ENDS + + +// FUNCTIONS SECTION STARTS +[#functions] +-- + +''' + +[float] +=== Functions +link:/Stream/streamAvailable{ext-relative}[available()] + +link:/Stream/streamRead{ext-relative}[read()] + +link:/Stream/streamFlush{ext-relative}[flush()] + +link:/Stream/streamFind{ext-relative}[find()] + +link:/Stream/streamFindUntil{ext-relative}[findUntil()] + +link:/Stream/streamPeek{ext-relative}[peek()] + +link:/Stream/streamReadBytes{ext-relative}[readBytes()] + +link:/Stream/streamReadBytesUntil{ext-relative}[readBytesUntil()] + +link:/Stream/streamReadString{ext-relative}[readString()] + +link:/Stream/streamReadStringUntil{ext-relative}[readStringUntil()] + +link:/Stream/streamParseInt{ext-relative}[parseInt()] + +link:/Stream/streamParseFloat{ext-relative}[parseFloat()] + +link:/Stream/streamSetTimeout{ext-relative}[setTimeout()] + +''' + +-- +// FUNCTIONS SECTION ENDS diff --git a/Language/Functions/Math/abs.adoc b/Language/Functions/Math/abs.adoc index d9683f1e3..7a24f07c1 100644 --- a/Language/Functions/Math/abs.adoc +++ b/Language/Functions/Math/abs.adoc @@ -48,8 +48,8 @@ Because of the way the abs() function is implemented, avoid using other function ---- abs(a++); // avoid this - yields incorrect results -a++; // use this instead - -abs(a); // keep other math outside the function +abs(a); // use this instead - +a++; // keep other math outside the function ---- [%hardbreaks] diff --git a/Language/Functions/Math/max.adoc b/Language/Functions/Math/max.adoc index 4a1ebbc4f..52ab6cf40 100644 --- a/Language/Functions/Math/max.adoc +++ b/Language/Functions/Math/max.adoc @@ -61,8 +61,8 @@ Because of the way the `max()` function is implemented, avoid using other functi ---- max(a--, 0); // avoid this - yields incorrect results -a--; // use this instead - -max(a, 0); // keep other math outside the function +max(a, 0); // use this instead - +a--; // keep other math outside the function ---- [%hardbreaks] diff --git a/Language/Functions/Math/min.adoc b/Language/Functions/Math/min.adoc index 5eea7d198..e86b8b99f 100644 --- a/Language/Functions/Math/min.adoc +++ b/Language/Functions/Math/min.adoc @@ -62,8 +62,8 @@ Because of the way the `min()` function is implemented, avoid using other functi ---- min(a++, 100); // avoid this - yields incorrect results -a++; -min(a, 100); // use this instead - keep other math outside the function +min(a, 100); +a++; // use this instead - keep other math outside the function ---- [%hardbreaks]