Reference.SoftwareSerialWrite History

Hide minor edits - Show changes to output

May 25, 2012, at 03:55 PM by Tom Igoe -
Changed lines 18-19 from:
SoftwareSerial mySerial(6, 7);
SoftwareSerial mySerial(10, 11);
November 04, 2011, at 02:56 PM by Scott Fitzgerald -
Added lines 1-38:
!!SoftwareSerial: write(data)


Prints data to the transmit pin of the software serial port as raw bytes. Works the same as the [[Serial.write]]() function.


[[Serial.write]]() for details


write() will return the number of bytes written, though reading that number is optional

(:source lang=arduino:)
SoftwareSerial mySerial(6, 7);

void setup()

void loop()
mySerial.write(45); // send a byte with the value 45

int bytesSent = mySerial.write(“hello”); //send the string “hello” and return the length of the string.

!!!!See also

* [[SoftwareSerialConstructor | SoftwareSerial]]()
* [[SoftwareSerialBegin | begin]]()
* [[SoftwareSerialRead | read]]()
* [[SoftwareSerialPrint | print]]()