You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Language/Functions/Communication/Serial/parseInt.adoc
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,21 @@
12
12
13
13
[float]
14
14
=== Description
15
-
Looks for the next valid integer in the incoming serial stream. `parseInt()` inherits from the link:stream{ext-relative}[Stream] utility class.
15
+
Looks for the next valid integer in the incoming serial `stream.parseInt()` inherits from the link:stream{ext-relative}[Stream] utility class.
16
16
17
-
If no valid integer is found within one second (adjustable through link:serialTimeout{ext-relative}[Serial.setTimeout()] ) a default value of 0 will be returned.
17
+
18
+
In particular:
19
+
20
+
* Initial characters that are not digits or a minus sign, are skipped; +
21
+
* Parsing stops when no characters have been read for a configurable time-out value, or a non-digit is read; +
22
+
* If no valid digits were read when the time-out (see Serial.setTimeout()) occurs, 0 is returned;
18
23
[%hardbreaks]
19
24
20
25
21
26
[float]
22
27
=== Syntax
23
28
`Serial.parseInt()`
24
-
29
+
`Serial.parseInt(char skipChar)`
25
30
26
31
_Arduino Mega only:_
27
32
@@ -32,11 +37,11 @@ _Arduino Mega only:_
32
37
33
38
[float]
34
39
=== Parameters
35
-
Nothing
40
+
`skipChar`: used to skip the indicated char in the search. Used for example to skip thousands divider.
0 commit comments