SoftwareSerial: write(data)
描述
透过软体序列介面传送资料。运作方式与 Serial.write()
相同。
参数
详情请看 Serial.write()
回传
byte
:write()
会回传传送资料的位元组数量
范例
SoftwareSerial mySerial(10, 11); void setup() { mySerial.begin(9600); } void loop() { mySerial.write(45); // 传送值为 45 的字元 int bytesSent = mySerial.write(“hello”); // 传送字串 "hello" 并且接收回传的值 }
See also
- SoftwareSerial()
- begin()
- print()
- 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.