查看Serial的源代码
←
Serial
跳转至:
导航
、
搜索
因为以下原因,你没有权限编辑本页:
你刚才请求的操作只对属于该用户组的用户开放:
用户
您可以查看并复制此页面的源代码:
{| border="0" cellpadding="10" width="100%" |- |width="40%" valign="top" align="left"| <font color="orange" size="+1">'''描述'''</font> <br> <br> Serial communication on pins TX/RX uses TTL logic levels (5V or 3.3V depending on the board). Don't connect these pins directly to an RS232 serial port; they operate at +/- 12V and can damage your Arduino board. Serial is used for communication between the Arduino board and a computer or other devices. All Arduino boards have at least one serial port (also known as a UART or USART): Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the computer via USB. Thus, if you use these functions, you cannot also use pins 0 and 1 for digital input or output. You can use the Arduino environment's built-in serial monitor to communicate with an Arduino board. Click the serial monitor button in the toolbar and select the same baud rate used in the call to begin(). The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). To use these pins to communicate with your personal computer, you will need an additional USB-to-serial adaptor, as they are not connected to the Mega's USB-to-serial adaptor. To use them to communicate with an external TTL serial device, connect the TX pin to your device's RX pin, the RX to your device's TX pin, and the ground of your Mega to your device's ground. The Arduino Due has three additional 3.3V TTL serial ports: Serial1 on pins 19 (RX) and 18 (TX); Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip, which is connected to the USB debug port. Additionally, there is a native USB-serial port on the SAM3X chip, SerialUSB'. The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX). Serial is reserved for USB CDC communication. For more information, refer to the Leonardo getting started page and hardware page. <br><br> |width="10%" valign="top" align="left"| <!-- 空白 --> |width="40%" valign="top" align="left"| <font color="orange" size="+1">'''函数'''</font><br> <br> :-[[if(Serial)| if(Serial)]] :-[[Serial.charAt()| charAt()]] :-[[Serial.available()| available()]] :-[[Serial.availableForWrite()| availableForWrite()]] :-[[Serial.begin()| begin()]] :-[[Serial.end()| end()]] :-[[Serial.find()| find()]] :-[[Serial.findUntil()| findUntil()]] :-[[Serial.flush()| flush()]] :-[[Serial.parseFloat()| parseFloat()]] :-[[Serial.parseInt()| parseInt()]] :-[[Serial.peek()| peek()]] :-[[Serial.print()| print()]] :-[[Serial.println()| println()]] :-[[Serial.read()| read()]] :-[[Serial.readBytes()| readBytes()]] :-[[Serial.readBytesUntil()| readBytesUntil()]] :-[[Serial.readString()| readString()]] :-[[Serial.readStringUntil()| readStringUntil()]] :-[[Serial.setTimeout()| setTimeout()]] :-[[Serial.write()| write()]] :-[[Serial.serialEvent()| serialEvent()]] <br> <font color="orange" size="+1">'''示例'''</font><br> :-[[ ReadASCIIString]] :-[[ ASCII Table]] :-[[ Dimmer]] :-[[ Graph]] :-[[ Physical Pixel]] :-[[ Virtual Color Mixer]] :-[[ Serial Call Response]] :-[[ Serial Call Response ASCII]] |width="10%" valign="top" align="left"| <!-- 空白 --> |} ---- [[Arduino语法参考 | 返回Arduino语法参考列表]] 更多建议和问题欢迎反馈至 [http://www.yfrobot.com YFRobot论坛]
返回
Serial
。
导航菜单
个人工具
登录
名字空间
页面
讨论
不转换
变种
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
台灣正體
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
YF-论坛提问
YFRobot-直营店
YFRobot-企业店
Arduino
Arduino之入门篇
Arduino入门教程
Arduino语法参考
Arduino库
Arduino核心代码
编程平台
Mixly库
Mind+库
MakeCode扩展
传感器系列
积木式传感器系列
黑板传感器系列
蓝板传感器系列
Micro:Bit
Micro:Bit 通用基础教程
Valon智能车
Valon-I
帮助
帮助
wiki语法参考
工具箱
链入页面
相关更改
特殊页面
页面信息