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.