# read

## 函数原型

```cpp
int HardwareSerial::read();
```

## 作用

向串口打印数据

`Serial.println()` 比 `Serial.print()` 多一个换行。

使用前必须用 `Serial.begin()` 初始化 `Serial`。

## 返回值

返回下一个字符串，就像C语言的 `getc()` 一样。

## 示例

```cpp
char c = Serial.read();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arduino.doc.skyone.host/core/serial/read.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
