串口波特率的设置:通常我们使用Serial.begin(speed)来完成串口的初始化,这种方式,只能配置串口的波特率. 使用Serial.begin(speed, config)可以配置数据位.校验位.停止位等.例如Serial.begin(9600,SERIAL_8E2)是将串口波特率设为9600,数据位8,偶校验,停止位2. 9600 串口波特率 SERIAL_8E2 8:8位 E:偶校验 2:停止位 config可用配置如下: 1: 少用 if (Serial)的用法:串口打开为真,串口…