Skip to content

Commit 82770c7

Browse files
author
SimonePDA
authored
Merge pull request #272 from robsoncouto/patch-9
Fixed Example code section
2 parents b103d39 + 9775d35 commit 82770c7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Language/Functions/Communication/Serial/available.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
title: Serial.available()
33
---
44

5-
6-
7-
85
= available()
96

107

@@ -31,20 +28,21 @@ _Arduino Mega only:_
3128

3229
[float]
3330
=== Parameters
34-
Nothing
31+
None
3532

3633
[float]
3734
=== Returns
3835
The number of bytes available to read .
3936
--
4037
// OVERVIEW SECTION ENDS
4138

42-
43-
44-
4539
// HOW TO USE SECTION STARTS
4640
[#howtouse]
4741
--
42+
[float]
43+
=== Example Code
44+
// Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄
45+
The following code returns a character received through the serial port.
4846

4947
[source,arduino]
5048
----
@@ -56,7 +54,7 @@ void setup() {
5654
5755
void loop() {
5856
59-
// send data only when you receive data:
57+
// reply only when you receive data:
6058
if (Serial.available() > 0) {
6159
// read the incoming byte:
6260
incomingByte = Serial.read();
@@ -70,6 +68,8 @@ void loop() {
7068
[%hardbreaks]
7169

7270
*Arduino Mega example:*
71+
This code sends data received in one serial port of the Arduino Mega to another. This can be used, for example, to connect a serial device to the computer through the Arduino board.
72+
7373
[source,arduino]
7474
----
7575
void setup() {

0 commit comments

Comments
 (0)