SoftwareSerial(rxPin, txPin)
描述
呼叫 SoftwareSerial(rxPin, txPin)
创建新的 SoftwareSerial
物件。
创建完 SoftwareSerial
物件之后还要呼叫 SoftwareSerial.begin() 启动序列介面的功能。
参数
rxPin
:用来接收序列资料的脚位
txPin
:用来传送序列资料的脚位
范例
#define rxPin 2 #define txPin 3 // 创建新的 SoftwareSerial 物件 SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
See also
- SoftwareSerial.begin()
- SoftwareSerial.read()
- SoftwareSerial.print()
- SoftwareSerial.println()
The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.