Skip to content

Commit 3313a64

Browse files
committed
Content update (UART section information)
1 parent b2ff81f commit 3313a64

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed
Loading
Loading

content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -725,15 +725,12 @@ The example sketch below showcases how to configure UART, read incoming data, an
725725
String incoming = "";
726726
727727
void setup() {
728-
// Begin serial communication at a baud rate of 9600
729-
Serial.begin(9600);
730-
731-
// Wait for the serial port to connect
732-
// This is necessary for boards that have native USB
733-
while (!Serial) {}
728+
// Initialize serial communication and wait up to 2.5 seconds for a connection
729+
Serial.begin(115200);
730+
for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500));
734731
735732
// Print a message to the Serial Monitor to indicate setup is complete
736-
Serial.println("UART Communication Setup Complete");
733+
Serial.println("- UART communication setup complete!");
737734
}
738735
739736
void loop() {
@@ -759,7 +756,7 @@ void loop() {
759756
// Example of transmitting data
760757
// Transmit the string "Hello world!" every second
761758
// Wait for 1 second before sending again
762-
Serial.println("Hello world!");
759+
Serial.println("- Hello world!");
763760
delay(1000);
764761
}
765762
@@ -778,14 +775,22 @@ void processData(String data) {
778775

779776
Let's analyze the example sketch. First, the necessary configurations are made:
780777

781-
- The UART communication is initialized at a baud rate of 9600.
778+
- The UART communication is initialized at a baud rate of 115200.
782779
- A loop continuously checks for available data and reads individual characters, storing them in a `String` variable.
783780
- A newline character indicates the end of a message, triggering the processing function.
784781

785782
The `processData()` function is called to process the received data. This example simply prints the data to the Arduino IDE's Serial Monitor. You can modify this function to perform different actions based on the received data. Finally, the example sketch shows how to send data using the `Serial.println()` function, which transmits the string `Hello world!` every second.
786783

787784
You should see the following output in the Arduino IDE's Serial Monitor:
788785

786+
![Example sketch output in the Arduino IDE's Serial Monitor](assets/user-manual-23.png)
787+
788+
You can also send information to the Portenta C33 using the Arduino IDE's Serial Monitor. In the `Message` box of the IDE's Serial Monitor, write a message (for example, `Portenta C33`) and press Enter; you should see the following output in the Arduino IDE's Serial Monitor:
789+
790+
![Example sketch output in the Arduino IDE's Serial Monitor](assets/user-manual-24.png)
791+
792+
You can download the example sketch [here](assets/UARTCommunication.zip).
793+
789794
### Wi-Fi®
790795

791796
The Portenta C33 board features an onboard Wi-Fi® module, the ESP32-C3-MINI-1U module from Espressif Systems®. The ESP32-C3-MINI-1U is a low-power, highly integrated Wi-Fi® and Bluetooth® System-on-Chip (SoC) solution designed for many IoT applications.
@@ -1082,7 +1087,6 @@ void loop() {
10821087
}
10831088
```
10841089

1085-
10861090
First, the necessary libraries are included:
10871091

10881092
- The `EthernetC33` library which contains the functionality required to communicate via Ethernet is included in the beginning.

0 commit comments

Comments
 (0)